@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $langs->loadLangs(array("admin", "other", "trips", "errors", "dict")); |
| 46 | 46 | |
| 47 | 47 | // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context |
| 48 | -$hookmanager->initHooks(array('admin', 'dictionaryadmin','expensereport_rules')); |
|
| 48 | +$hookmanager->initHooks(array('admin', 'dictionaryadmin', 'expensereport_rules')); |
|
| 49 | 49 | |
| 50 | 50 | $object = new ExpenseReportRule($db); |
| 51 | 51 | |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | if (!$error) { |
| 159 | - header('Location: ' . $_SERVER['PHP_SELF']); |
|
| 159 | + header('Location: '.$_SERVER['PHP_SELF']); |
|
| 160 | 160 | exit; |
| 161 | 161 | } else { |
| 162 | 162 | $action = ''; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | dol_print_error($object->db); |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - header('Location: ' . $_SERVER['PHP_SELF']); |
|
| 173 | + header('Location: '.$_SERVER['PHP_SELF']); |
|
| 174 | 174 | exit; |
| 175 | 175 | } |
| 176 | 176 | |
@@ -205,41 +205,41 @@ discard block |
||
| 205 | 205 | $head = expensereport_admin_prepare_head(); |
| 206 | 206 | print dol_get_fiche_head($head, 'expenserules', $langs->trans("ExpenseReportsRules"), -1, 'trip'); |
| 207 | 207 | |
| 208 | -echo '<span class="opacitymedium">' . $langs->trans('ExpenseReportRulesDesc') . '</span>'; |
|
| 208 | +echo '<span class="opacitymedium">'.$langs->trans('ExpenseReportRulesDesc').'</span>'; |
|
| 209 | 209 | print '<br><br>'; |
| 210 | 210 | |
| 211 | 211 | if ($action != 'edit') { |
| 212 | - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; |
|
| 213 | - echo '<input type="hidden" name="token" value="' . newToken() . '" />'; |
|
| 212 | + echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post">'; |
|
| 213 | + echo '<input type="hidden" name="token" value="'.newToken().'" />'; |
|
| 214 | 214 | echo '<input type="hidden" name="action" value="save" />'; |
| 215 | 215 | |
| 216 | 216 | echo '<table class="noborder centpercent">'; |
| 217 | 217 | |
| 218 | 218 | echo '<tr class="liste_titre headerexpensereportrules">'; |
| 219 | - echo '<th class="linecolapplyto">' . $langs->trans('ExpenseReportApplyTo') . '</th>'; |
|
| 220 | - echo '<th class="linecoltype">' . $langs->trans('Type') . '</th>'; |
|
| 221 | - echo '<th class="linecollimiton">' . $langs->trans('ExpenseReportLimitOn') . '</th>'; |
|
| 222 | - echo '<th class="linecoldatestart">' . $langs->trans('ExpenseReportDateStart') . '</th>'; |
|
| 223 | - echo '<th class="linecoldateend">' . $langs->trans('ExpenseReportDateEnd') . '</th>'; |
|
| 224 | - echo '<th class="linecollimitamount">' . $langs->trans('ExpenseReportLimitAmount') . '</th>'; |
|
| 225 | - echo '<th class="linecolrestrictive">' . $langs->trans('ExpenseReportRestrictive') . '</th>'; |
|
| 219 | + echo '<th class="linecolapplyto">'.$langs->trans('ExpenseReportApplyTo').'</th>'; |
|
| 220 | + echo '<th class="linecoltype">'.$langs->trans('Type').'</th>'; |
|
| 221 | + echo '<th class="linecollimiton">'.$langs->trans('ExpenseReportLimitOn').'</th>'; |
|
| 222 | + echo '<th class="linecoldatestart">'.$langs->trans('ExpenseReportDateStart').'</th>'; |
|
| 223 | + echo '<th class="linecoldateend">'.$langs->trans('ExpenseReportDateEnd').'</th>'; |
|
| 224 | + echo '<th class="linecollimitamount">'.$langs->trans('ExpenseReportLimitAmount').'</th>'; |
|
| 225 | + echo '<th class="linecolrestrictive">'.$langs->trans('ExpenseReportRestrictive').'</th>'; |
|
| 226 | 226 | echo '<th> </th>'; |
| 227 | 227 | echo '</tr>'; |
| 228 | 228 | |
| 229 | 229 | echo '<tr class="oddeven">'; |
| 230 | 230 | echo '<td>'; |
| 231 | - echo '<div class="float linecolapplyto">' . $form->selectarray('apply_to', $tab_apply, '', 0) . '</div>'; |
|
| 232 | - echo '<div id="user" class="float linecoluser">' . $form->select_dolusers('', 'fk_user') . '</div>'; |
|
| 233 | - echo '<div id="group" class="float linecolgroup">' . $form->select_dolgroups(0, 'fk_usergroup') . '</div>'; |
|
| 231 | + echo '<div class="float linecolapplyto">'.$form->selectarray('apply_to', $tab_apply, '', 0).'</div>'; |
|
| 232 | + echo '<div id="user" class="float linecoluser">'.$form->select_dolusers('', 'fk_user').'</div>'; |
|
| 233 | + echo '<div id="group" class="float linecolgroup">'.$form->select_dolgroups(0, 'fk_usergroup').'</div>'; |
|
| 234 | 234 | echo '</td>'; |
| 235 | 235 | |
| 236 | - echo '<td class="linecoltype">' . $form->selectExpenseFees('', 'fk_c_type_fees', 0, 1, 1) . '</td>'; |
|
| 237 | - echo '<td class="linecoltyperule">' . $form->selectarray('code_expense_rules_type', $tab_rules_type, '', 0) . '</td>'; |
|
| 238 | - echo '<td class="linecoldatestart">' . $form->selectDate(strtotime(date('Y-m-01', dol_now())), 'start', 0, 0, 0, '', 1, 0) . '</td>'; |
|
| 239 | - echo '<td class="linecoldateend">' . $form->selectDate(strtotime(date('Y-m-t', dol_now())), 'end', 0, 0, 0, '', 1, 0) . '</td>'; |
|
| 236 | + echo '<td class="linecoltype">'.$form->selectExpenseFees('', 'fk_c_type_fees', 0, 1, 1).'</td>'; |
|
| 237 | + echo '<td class="linecoltyperule">'.$form->selectarray('code_expense_rules_type', $tab_rules_type, '', 0).'</td>'; |
|
| 238 | + echo '<td class="linecoldatestart">'.$form->selectDate(strtotime(date('Y-m-01', dol_now())), 'start', 0, 0, 0, '', 1, 0).'</td>'; |
|
| 239 | + echo '<td class="linecoldateend">'.$form->selectDate(strtotime(date('Y-m-t', dol_now())), 'end', 0, 0, 0, '', 1, 0).'</td>'; |
|
| 240 | 240 | echo '<td class="linecolamount"><input type="text" value="" class="maxwidth100" name="amount" class="amount right" /></td>'; |
| 241 | - echo '<td class="linecolrestrictive">' . $form->selectyesno('restrictive', 0, 1) . '</td>'; |
|
| 242 | - echo '<td class="right linecolbutton"><input type="submit" class="button button-add" value="' . $langs->trans('Add') . '" /></td>'; |
|
| 241 | + echo '<td class="linecolrestrictive">'.$form->selectyesno('restrictive', 0, 1).'</td>'; |
|
| 242 | + echo '<td class="right linecolbutton"><input type="submit" class="button button-add" value="'.$langs->trans('Add').'" /></td>'; |
|
| 243 | 243 | echo '</tr>'; |
| 244 | 244 | |
| 245 | 245 | echo '</table>'; |
@@ -247,11 +247,11 @@ discard block |
||
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | |
| 250 | -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; |
|
| 251 | -echo '<input type="hidden" name="token" value="' . newToken() . '" />'; |
|
| 250 | +echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post">'; |
|
| 251 | +echo '<input type="hidden" name="token" value="'.newToken().'" />'; |
|
| 252 | 252 | |
| 253 | 253 | if ($action == 'edit') { |
| 254 | - echo '<input type="hidden" name="id" value="' . $object->id . '" />'; |
|
| 254 | + echo '<input type="hidden" name="id" value="'.$object->id.'" />'; |
|
| 255 | 255 | echo '<input type="hidden" name="action" value="save" />'; |
| 256 | 256 | } |
| 257 | 257 | |
@@ -261,13 +261,13 @@ discard block |
||
| 261 | 261 | echo '<table class="noborder centpercent">'; |
| 262 | 262 | |
| 263 | 263 | echo '<tr class="liste_titre expensereportrules">'; |
| 264 | -echo '<th class="linecolapplyto">' . $langs->trans('ExpenseReportApplyTo') . '</th>'; |
|
| 265 | -echo '<th class="linecoltype">' . $langs->trans('Type') . '</th>'; |
|
| 266 | -echo '<th class="linecollimiton">' . $langs->trans('ExpenseReportLimitOn') . '</th>'; |
|
| 267 | -echo '<th class="linecoldatestart">' . $langs->trans('ExpenseReportDateStart') . '</th>'; |
|
| 268 | -echo '<th class="linecoldateend">' . $langs->trans('ExpenseReportDateEnd') . '</th>'; |
|
| 269 | -echo '<th class="linecollimitamount">' . $langs->trans('ExpenseReportLimitAmount') . '</th>'; |
|
| 270 | -echo '<th class="linecolrestrictive">' . $langs->trans('ExpenseReportRestrictive') . '</th>'; |
|
| 264 | +echo '<th class="linecolapplyto">'.$langs->trans('ExpenseReportApplyTo').'</th>'; |
|
| 265 | +echo '<th class="linecoltype">'.$langs->trans('Type').'</th>'; |
|
| 266 | +echo '<th class="linecollimiton">'.$langs->trans('ExpenseReportLimitOn').'</th>'; |
|
| 267 | +echo '<th class="linecoldatestart">'.$langs->trans('ExpenseReportDateStart').'</th>'; |
|
| 268 | +echo '<th class="linecoldateend">'.$langs->trans('ExpenseReportDateEnd').'</th>'; |
|
| 269 | +echo '<th class="linecollimitamount">'.$langs->trans('ExpenseReportLimitAmount').'</th>'; |
|
| 270 | +echo '<th class="linecolrestrictive">'.$langs->trans('ExpenseReportRestrictive').'</th>'; |
|
| 271 | 271 | echo '<th> </th>'; |
| 272 | 272 | echo '</tr>'; |
| 273 | 273 | |
@@ -277,16 +277,16 @@ discard block |
||
| 277 | 277 | echo '<td class="linecolusergroup">'; |
| 278 | 278 | if ($action == 'edit' && $object->id == $rule->id) { |
| 279 | 279 | $selected = ($object->is_for_all > 0) ? 'A' : ($object->fk_usergroup > 0 ? 'G' : 'U'); |
| 280 | - echo '<div class="float">' . $form->selectarray('apply_to', $tab_apply, $selected, 0) . '</div>'; |
|
| 281 | - echo '<div id="user" class="float">' . $form->select_dolusers($object->fk_user, 'fk_user') . '</div>'; |
|
| 282 | - echo '<div id="group" class="float">' . $form->select_dolgroups($object->fk_usergroup, 'fk_usergroup') . '</div>'; |
|
| 280 | + echo '<div class="float">'.$form->selectarray('apply_to', $tab_apply, $selected, 0).'</div>'; |
|
| 281 | + echo '<div id="user" class="float">'.$form->select_dolusers($object->fk_user, 'fk_user').'</div>'; |
|
| 282 | + echo '<div id="group" class="float">'.$form->select_dolgroups($object->fk_usergroup, 'fk_usergroup').'</div>'; |
|
| 283 | 283 | } else { |
| 284 | 284 | if ($rule->is_for_all > 0) { |
| 285 | 285 | echo $tab_apply['A']; |
| 286 | 286 | } elseif ($rule->fk_usergroup > 0) { |
| 287 | - echo $tab_apply['G'] . ' (' . $rule->getGroupLabel() . ')'; |
|
| 287 | + echo $tab_apply['G'].' ('.$rule->getGroupLabel().')'; |
|
| 288 | 288 | } elseif ($rule->fk_user > 0) { |
| 289 | - echo $tab_apply['U'] . ' (' . $rule->getUserName() . ')'; |
|
| 289 | + echo $tab_apply['U'].' ('.$rule->getUserName().')'; |
|
| 290 | 290 | } |
| 291 | 291 | } |
| 292 | 292 | echo '</td>'; |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | // Amount |
| 340 | 340 | echo '<td class="linecolamount">'; |
| 341 | 341 | if ($action == 'edit' && $object->id == $rule->id) { |
| 342 | - echo '<input type="text" value="' . price2num($object->amount) . '" name="amount" class="amount width50 right" />'; |
|
| 342 | + echo '<input type="text" value="'.price2num($object->amount).'" name="amount" class="amount width50 right" />'; |
|
| 343 | 343 | } else { |
| 344 | 344 | echo price($rule->amount, 0, $langs, 1, -1, -1, getDolCurrency()); |
| 345 | 345 | } |
@@ -357,11 +357,11 @@ discard block |
||
| 357 | 357 | |
| 358 | 358 | echo '<td class="center">'; |
| 359 | 359 | if ($object->id != $rule->id) { |
| 360 | - echo '<a class="editfielda paddingright paddingleft" href="' . $_SERVER['PHP_SELF'] . '?action=edit&token=' . newToken() . '&id=' . $rule->id . '">' . img_edit() . '</a> '; |
|
| 361 | - echo '<a class="paddingright paddingleft" href="' . $_SERVER['PHP_SELF'] . '?action=delete&token=' . newToken() . '&id=' . $rule->id . '">' . img_delete() . '</a>'; |
|
| 360 | + echo '<a class="editfielda paddingright paddingleft" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&id='.$rule->id.'">'.img_edit().'</a> '; |
|
| 361 | + echo '<a class="paddingright paddingleft" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&id='.$rule->id.'">'.img_delete().'</a>'; |
|
| 362 | 362 | } else { |
| 363 | - echo '<input type="submit" class="button button-edit" value="' . $langs->trans('Update') . '" /> '; |
|
| 364 | - echo '<a href="' . $_SERVER['PHP_SELF'] . '" class="button button-cancel">' . $langs->trans("Cancel") . '</a>'; |
|
| 363 | + echo '<input type="submit" class="button button-edit" value="'.$langs->trans('Update').'" /> '; |
|
| 364 | + echo '<a href="'.$_SERVER['PHP_SELF'].'" class="button button-cancel">'.$langs->trans("Cancel").'</a>'; |
|
| 365 | 365 | } |
| 366 | 366 | echo '</td>'; |
| 367 | 367 | |
@@ -189,17 +189,17 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | $newtimeyear = (int) dol_print_date($newtime, '%Y'); |
| 191 | 191 | $newtimemonth = (int) dol_print_date($newtime, '%m'); |
| 192 | - $newtimetotalmonths = (($newtimeyear * 12) + $newtimemonth); |
|
| 192 | + $newtimetotalmonths = (($newtimeyear * 12) + $newtimemonth); |
|
| 193 | 193 | |
| 194 | 194 | if ($monthsexpected < $newtimetotalmonths || $monthsexpected > $newtimetotalmonths) { // If months differs |
| 195 | 195 | $newtimehours = (int) dol_print_date($newtime, '%H'); |
| 196 | 196 | $newtimemins = (int) dol_print_date($newtime, '%M'); |
| 197 | 197 | $newtimesecs = (int) dol_print_date($newtime, '%S'); |
| 198 | 198 | |
| 199 | - $datelim = dol_mktime($newtimehours, $newtimemins, $newtimesecs, $newtimemonth, 1, $newtimeyear); // Take first day |
|
| 200 | - $datelim -= (3600 * 24); // Remove 1 day to get the last day of month |
|
| 199 | + $datelim = dol_mktime($newtimehours, $newtimemins, $newtimesecs, $newtimemonth, 1, $newtimeyear); // Take first day |
|
| 200 | + $datelim -= (3600 * 24); // Remove 1 day to get the last day of month |
|
| 201 | 201 | |
| 202 | - $date->setTimestamp($datelim); // Set new date |
|
| 202 | + $date->setTimestamp($datelim); // Set new date |
|
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | return $date->getTimestamp(); |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | $sql = "SELECT id, code, entity, fk_country, dayrule, year, month, day, active"; |
| 807 | 807 | $sql .= " FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday"; |
| 808 | 808 | $sql .= " WHERE active = 1 and fk_country IN (0".($country_id > 0 ? ", ".$country_id : 0).")"; |
| 809 | - $sql .= " AND entity IN (0," .getEntity('holiday') .")"; |
|
| 809 | + $sql .= " AND entity IN (0,".getEntity('holiday').")"; |
|
| 810 | 810 | |
| 811 | 811 | $resql = $db->query($sql); |
| 812 | 812 | if ($resql) { |
@@ -837,7 +837,7 @@ discard block |
||
| 837 | 837 | $jour = (int) gmdate("d", $timestampStart); |
| 838 | 838 | $mois = (int) gmdate("m", $timestampStart); |
| 839 | 839 | $annee = (int) gmdate("Y", $timestampStart); |
| 840 | - $jour_semaine = (int) gmdate("w", $timestampStart); // sunday = 0, monday = 1, ... |
|
| 840 | + $jour_semaine = (int) gmdate("w", $timestampStart); // sunday = 0, monday = 1, ... |
|
| 841 | 841 | |
| 842 | 842 | //print "jour=".$jour." month=".$mois." year=".$annee." includesaturday=".$includesaturday." includesunday=".$includesunday."\n"; |
| 843 | 843 | foreach ($arrayOfPublicHolidays as $entrypublicholiday) { |
@@ -1063,13 +1063,13 @@ discard block |
||
| 1063 | 1063 | $country_id = dol_getIdFromCode($db, $countryCodeOrId, 'c_country', 'code', 'rowid'); |
| 1064 | 1064 | } |
| 1065 | 1065 | |
| 1066 | - if (empty($conf->cache['arrayOfActivePublicHolidays_' . $country_id])) { |
|
| 1066 | + if (empty($conf->cache['arrayOfActivePublicHolidays_'.$country_id])) { |
|
| 1067 | 1067 | // Loop on public holiday defined into hrm_public_holiday for the day, month and year analyzed |
| 1068 | 1068 | $tmpArrayOfPublicHolidays = array(); |
| 1069 | 1069 | $sql = "SELECT id, code, entity, fk_country, dayrule, year, month, day, active"; |
| 1070 | - $sql .= " FROM " . MAIN_DB_PREFIX . "c_hrm_public_holiday"; |
|
| 1071 | - $sql .= " WHERE active = 1 and fk_country IN (0" . ($country_id > 0 ? ", " . $country_id : 0) . ")"; |
|
| 1072 | - $sql .= " AND entity IN (0," . getEntity('holiday') . ")"; |
|
| 1070 | + $sql .= " FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday"; |
|
| 1071 | + $sql .= " WHERE active = 1 and fk_country IN (0".($country_id > 0 ? ", ".$country_id : 0).")"; |
|
| 1072 | + $sql .= " AND entity IN (0,".getEntity('holiday').")"; |
|
| 1073 | 1073 | |
| 1074 | 1074 | $resql = $db->query($sql); |
| 1075 | 1075 | if ($resql) { |
@@ -1082,14 +1082,14 @@ discard block |
||
| 1082 | 1082 | } |
| 1083 | 1083 | } else { |
| 1084 | 1084 | dol_syslog($db->lasterror(), LOG_ERR); |
| 1085 | - return 'Error sql ' . $db->lasterror(); |
|
| 1085 | + return 'Error sql '.$db->lasterror(); |
|
| 1086 | 1086 | } |
| 1087 | 1087 | |
| 1088 | 1088 | //var_dump($tmpArrayOfPublicHolidays); |
| 1089 | - $conf->cache['arrayOfActivePublicHolidays_' . $country_id] = $tmpArrayOfPublicHolidays; |
|
| 1089 | + $conf->cache['arrayOfActivePublicHolidays_'.$country_id] = $tmpArrayOfPublicHolidays; |
|
| 1090 | 1090 | } |
| 1091 | 1091 | |
| 1092 | - $arrayOfPublicHolidays = $conf->cache['arrayOfActivePublicHolidays_' . $country_id]; |
|
| 1092 | + $arrayOfPublicHolidays = $conf->cache['arrayOfActivePublicHolidays_'.$country_id]; |
|
| 1093 | 1093 | $listFeries = []; |
| 1094 | 1094 | $i = 0; |
| 1095 | 1095 | while ((($lastday == 0 && $timestampStart < $timestampEnd) || ($lastday && $timestampStart <= $timestampEnd)) |
@@ -44,14 +44,14 @@ discard block |
||
| 44 | 44 | ' |
| 45 | 45 | @phan-var-force ?string $uploaddir |
| 46 | 46 | '; |
| 47 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 48 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php'; |
|
| 49 | -require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 50 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 51 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 52 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
|
| 53 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 54 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php'; |
|
| 47 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 48 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; |
|
| 49 | +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 50 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 51 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 52 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; |
|
| 53 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 54 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php'; |
|
| 55 | 55 | |
| 56 | 56 | // Load translation files required by the page |
| 57 | 57 | $langsLoad = array('projects', 'bills', 'orders', 'companies'); |
@@ -71,10 +71,10 @@ discard block |
||
| 71 | 71 | $optioncss = GETPOST('optioncss', 'alpha'); |
| 72 | 72 | $mode = GETPOST('mode', 'alpha'); |
| 73 | 73 | |
| 74 | -$id = GETPOSTINT('id'); // Id of task |
|
| 75 | -$ref = GETPOST('ref', 'alpha'); // Ref of task |
|
| 76 | -$projectid = GETPOSTINT('projectid'); // Id of project |
|
| 77 | -$lineid = GETPOSTINT('lineid'); // Id of time spent line |
|
| 74 | +$id = GETPOSTINT('id'); // Id of task |
|
| 75 | +$ref = GETPOST('ref', 'alpha'); // Ref of task |
|
| 76 | +$projectid = GETPOSTINT('projectid'); // Id of project |
|
| 77 | +$lineid = GETPOSTINT('lineid'); // Id of time spent line |
|
| 78 | 78 | $withproject = GETPOSTINT('withproject'); |
| 79 | 79 | $project_ref = GETPOST('project_ref', 'alpha'); |
| 80 | 80 | $tab = GETPOST('tab', 'aZ09'); |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | -include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
|
| 184 | +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
|
| 185 | 185 | |
| 186 | 186 | // Purge search criteria |
| 187 | 187 | if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | |
| 293 | 293 | if (!$error) { |
| 294 | 294 | if ($id && GETPOSTINT('taskid') != $id) { // GETPOSTINT('taskid') is the id of new task |
| 295 | - $id_temp = GETPOSTINT('taskid'); // should not overwrite $id |
|
| 295 | + $id_temp = GETPOSTINT('taskid'); // should not overwrite $id |
|
| 296 | 296 | |
| 297 | 297 | $object->fetchTimeSpent($lineid); |
| 298 | 298 | |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | } else { |
| 330 | - $object->fetch($id, $ref); // $object is Task |
|
| 330 | + $object->fetch($id, $ref); // $object is Task |
|
| 331 | 331 | |
| 332 | 332 | $object->fetchTimeSpent(GETPOSTINT('lineid')); |
| 333 | 333 | |
@@ -370,10 +370,10 @@ discard block |
||
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) { |
| 373 | - $object->fetchTimeSpent(GETPOSTINT('lineid')); // load properties like $object->timespent_xxx |
|
| 373 | + $object->fetchTimeSpent(GETPOSTINT('lineid')); // load properties like $object->timespent_xxx |
|
| 374 | 374 | |
| 375 | 375 | if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
| 376 | - $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
|
| 376 | + $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
|
| 377 | 377 | |
| 378 | 378 | if ($result < 0) { |
| 379 | 379 | $langs->load("errors"); |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | if (count($tasksarray) > 0) { |
| 394 | 394 | $id = $tasksarray[0]->id; |
| 395 | 395 | } else { |
| 396 | - header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode)); |
|
| 396 | + header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); |
|
| 397 | 397 | exit; |
| 398 | 398 | } |
| 399 | 399 | } |
@@ -432,9 +432,9 @@ discard block |
||
| 432 | 432 | if (!($projectstatic->thirdparty->id > 0)) { |
| 433 | 433 | setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors'); |
| 434 | 434 | } else { |
| 435 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 436 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 437 | - include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 435 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 436 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 437 | + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 438 | 438 | |
| 439 | 439 | $tmpinvoice = new Facture($db); |
| 440 | 440 | $tmptimespent = new Task($db); |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | $arrayoftasks = array(); |
| 503 | 503 | foreach ($toselect as $key => $value) { |
| 504 | 504 | // Get userid, timepent |
| 505 | - $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
|
| 505 | + $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
|
| 506 | 506 | $arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
| 507 | 507 | $arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
| 508 | 508 | } |
@@ -575,7 +575,7 @@ discard block |
||
| 575 | 575 | } |
| 576 | 576 | |
| 577 | 577 | // Add lines |
| 578 | - $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice").' - '.$username . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject); |
|
| 578 | + $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice").' - '.$username.' : '.$qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject); |
|
| 579 | 579 | if ($lineid < 0) { |
| 580 | 580 | $error++; |
| 581 | 581 | setEventMessages(null, $tmpinvoice->errors, 'errors'); |
@@ -608,16 +608,16 @@ discard block |
||
| 608 | 608 | |
| 609 | 609 | $arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration; |
| 610 | 610 | $arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm; |
| 611 | - $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref . ' - ' . $ftask->label . ' - ' . $username; |
|
| 611 | + $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username; |
|
| 612 | 612 | $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $object->timespent_note); |
| 613 | 613 | |
| 614 | 614 | if (!empty($withdetail)) { |
| 615 | 615 | if (!empty($object->timespent_withhour)) { |
| 616 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour)); |
|
| 616 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_datehour)); |
|
| 617 | 617 | } else { |
| 618 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_date)); |
|
| 618 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_date)); |
|
| 619 | 619 | } |
| 620 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration") . ': ' . convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY)); |
|
| 620 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration").': '.convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY)); |
|
| 621 | 621 | } |
| 622 | 622 | $arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user; |
| 623 | 623 | $arrayoftasks[$object->timespent_id]['fk_product'] = $object->timespent_fk_product; |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | $arrayoftasks = array(); |
| 696 | 696 | foreach ($toselect as $key => $value) { |
| 697 | 697 | // Get userid, timepent |
| 698 | - $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utility method found into Task object) |
|
| 698 | + $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utility method found into Task object) |
|
| 699 | 699 | // $object->id is now the task id |
| 700 | 700 | $arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
| 701 | 701 | $arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
@@ -771,7 +771,7 @@ discard block |
||
| 771 | 771 | // Add lines |
| 772 | 772 | $date_start = ''; |
| 773 | 773 | $date_end = ''; |
| 774 | - $lineName = $ftask->ref . ' - ' . $ftask->label; |
|
| 774 | + $lineName = $ftask->ref.' - '.$ftask->label; |
|
| 775 | 775 | $lineid = $tmpinvoice->addline($lineName, (float) $pu_ht_for_task, (float) price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject, $date_start, $date_end, 0, 0, 0, 'HT', 0, 1, -1, 0, '', 0, 0, 0, $pa_ht); |
| 776 | 776 | if ($lineid < 0) { |
| 777 | 777 | $error++; |
@@ -781,8 +781,8 @@ discard block |
||
| 781 | 781 | |
| 782 | 782 | if (!$error) { |
| 783 | 783 | // Update lineid into line of timespent |
| 784 | - $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'element_time SET invoice_line_id = ' . ((int) $lineid) . ', invoice_id = ' . ((int) $tmpinvoice->id); |
|
| 785 | - $sql .= ' WHERE rowid IN (' . $db->sanitize(implode(',', $toselect)) . ')'; |
|
| 784 | + $sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id); |
|
| 785 | + $sql .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $toselect)).')'; |
|
| 786 | 786 | $result = $db->query($sql); |
| 787 | 787 | if (!$result) { |
| 788 | 788 | $error++; |
@@ -818,12 +818,12 @@ discard block |
||
| 818 | 818 | if (!($projectstatic->thirdparty->id > 0)) { |
| 819 | 819 | setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors'); |
| 820 | 820 | } else { |
| 821 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 822 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 823 | - include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 821 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 822 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 823 | + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 824 | 824 | |
| 825 | 825 | |
| 826 | - require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php'; |
|
| 826 | + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; |
|
| 827 | 827 | $tmpinter = new Fichinter($db); |
| 828 | 828 | $tmptimespent = new Task($db); |
| 829 | 829 | $fuser = new User($db); |
@@ -835,7 +835,7 @@ discard block |
||
| 835 | 835 | $tmpinter->socid = $projectstatic->thirdparty->id; |
| 836 | 836 | $tmpinter->date = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); |
| 837 | 837 | $tmpinter->fk_project = $projectstatic->id; |
| 838 | - $tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : ''); |
|
| 838 | + $tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : ''); |
|
| 839 | 839 | |
| 840 | 840 | if ($interToUse) { |
| 841 | 841 | $tmpinter->fetch($interToUse); |
@@ -868,7 +868,7 @@ discard block |
||
| 868 | 868 | $qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); |
| 869 | 869 | |
| 870 | 870 | // Add lines |
| 871 | - $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), (int) $value['date'], $value['timespent']); |
|
| 871 | + $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), (int) $value['date'], $value['timespent']); |
|
| 872 | 872 | |
| 873 | 873 | if ($lineid > 0) { |
| 874 | 874 | // Link timespent to intervention |
@@ -912,9 +912,9 @@ discard block |
||
| 912 | 912 | //$result = $projectstatic->fetch($object->fk_project); |
| 913 | 913 | $arrayofselected = is_array($toselect) ? $toselect : array(); |
| 914 | 914 | |
| 915 | -$title = $object->ref . ' - ' . $langs->trans("TimeSpent"); |
|
| 915 | +$title = $object->ref.' - '.$langs->trans("TimeSpent"); |
|
| 916 | 916 | if (!empty($withproject)) { |
| 917 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : ''); |
|
| 917 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
| 918 | 918 | } |
| 919 | 919 | $help_url = ''; |
| 920 | 920 | |
@@ -923,13 +923,13 @@ discard block |
||
| 923 | 923 | |
| 924 | 924 | $param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : ''); |
| 925 | 925 | if ($search_user) { |
| 926 | - $param .= '&search_user=' . ((int) $search_user); |
|
| 926 | + $param .= '&search_user='.((int) $search_user); |
|
| 927 | 927 | } |
| 928 | 928 | if ($search_month) { |
| 929 | - $param .= '&search_month=' . ((int) $search_month); |
|
| 929 | + $param .= '&search_month='.((int) $search_month); |
|
| 930 | 930 | } |
| 931 | 931 | if ($search_year) { |
| 932 | - $param .= '&search_year=' . ((int) $search_year); |
|
| 932 | + $param .= '&search_year='.((int) $search_year); |
|
| 933 | 933 | } |
| 934 | 934 | |
| 935 | 935 | |
@@ -981,14 +981,14 @@ discard block |
||
| 981 | 981 | $morehtmlref .= $projectstatic->title; |
| 982 | 982 | // Thirdparty |
| 983 | 983 | if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { |
| 984 | - $morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
| 984 | + $morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
| 985 | 985 | } |
| 986 | 986 | $morehtmlref .= '</div>'; |
| 987 | 987 | |
| 988 | 988 | // Define a complementary filter for search of next/prev ref. |
| 989 | 989 | if (!$user->hasRight('projet', 'all', 'lire')) { |
| 990 | 990 | $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); |
| 991 | - $projectstatic->next_prev_filter = "rowid:IN:" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); |
|
| 991 | + $projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); |
|
| 992 | 992 | } |
| 993 | 993 | |
| 994 | 994 | dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); |
@@ -1006,25 +1006,25 @@ discard block |
||
| 1006 | 1006 | print '</td>'; |
| 1007 | 1007 | print '<td>'; |
| 1008 | 1008 | if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { |
| 1009 | - print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> '; |
|
| 1009 | + print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> '; |
|
| 1010 | 1010 | $htmltext = $langs->trans("ProjectFollowOpportunity"); |
| 1011 | 1011 | print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); |
| 1012 | 1012 | print '<br>'; |
| 1013 | 1013 | } |
| 1014 | 1014 | if (!getDolGlobalString('PROJECT_HIDE_TASKS')) { |
| 1015 | - print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> '; |
|
| 1015 | + print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> '; |
|
| 1016 | 1016 | $htmltext = $langs->trans("ProjectFollowTasks"); |
| 1017 | 1017 | print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); |
| 1018 | 1018 | print '<br>'; |
| 1019 | 1019 | } |
| 1020 | 1020 | if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) { |
| 1021 | - print '<input type="checkbox" disabled name="usage_bill_time"' . (GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')) . '"> '; |
|
| 1021 | + print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')).'"> '; |
|
| 1022 | 1022 | $htmltext = $langs->trans("ProjectBillTimeDescription"); |
| 1023 | 1023 | print $form->textwithpicto($langs->trans("BillTime"), $htmltext); |
| 1024 | 1024 | print '<br>'; |
| 1025 | 1025 | } |
| 1026 | 1026 | if (isModEnabled('eventorganization')) { |
| 1027 | - print '<input type="checkbox" disabled name="usage_organize_event"' . (GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')) . '"> '; |
|
| 1027 | + print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> '; |
|
| 1028 | 1028 | $htmltext = $langs->trans("EventOrganizationDescriptionLong"); |
| 1029 | 1029 | print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); |
| 1030 | 1030 | } |
@@ -1032,14 +1032,14 @@ discard block |
||
| 1032 | 1032 | } |
| 1033 | 1033 | |
| 1034 | 1034 | // Budget |
| 1035 | - print '<tr><td>' . $langs->trans("Budget") . '</td><td>'; |
|
| 1035 | + print '<tr><td>'.$langs->trans("Budget").'</td><td>'; |
|
| 1036 | 1036 | if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { |
| 1037 | - print '<span class="amount">' . price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency) . '</span>'; |
|
| 1037 | + print '<span class="amount">'.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>'; |
|
| 1038 | 1038 | } |
| 1039 | 1039 | print '</td></tr>'; |
| 1040 | 1040 | |
| 1041 | 1041 | // Date start - end project |
| 1042 | - print '<tr><td>' . $langs->trans("Dates") . '</td><td>'; |
|
| 1042 | + print '<tr><td>'.$langs->trans("Dates").'</td><td>'; |
|
| 1043 | 1043 | $start = dol_print_date($projectstatic->date_start, 'day'); |
| 1044 | 1044 | print($start ? $start : '?'); |
| 1045 | 1045 | $end = dol_print_date($projectstatic->date_end, 'day'); |
@@ -1051,7 +1051,7 @@ discard block |
||
| 1051 | 1051 | print '</td></tr>'; |
| 1052 | 1052 | |
| 1053 | 1053 | // Visibility |
| 1054 | - print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>'; |
|
| 1054 | + print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>'; |
|
| 1055 | 1055 | if ($projectstatic->public) { |
| 1056 | 1056 | print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"'); |
| 1057 | 1057 | print $langs->trans('SharedProject'); |
@@ -1065,7 +1065,7 @@ discard block |
||
| 1065 | 1065 | $cols = 2; |
| 1066 | 1066 | $savobject = $object; |
| 1067 | 1067 | $object = $projectstatic; |
| 1068 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
| 1068 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
| 1069 | 1069 | $object = $savobject; |
| 1070 | 1070 | |
| 1071 | 1071 | print '</table>'; |
@@ -1078,7 +1078,7 @@ discard block |
||
| 1078 | 1078 | |
| 1079 | 1079 | // Categories |
| 1080 | 1080 | if (isModEnabled('category')) { |
| 1081 | - print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>'; |
|
| 1081 | + print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>'; |
|
| 1082 | 1082 | print $form->showCategories($projectstatic->id, 'project', 1); |
| 1083 | 1083 | print "</td></tr>"; |
| 1084 | 1084 | } |
@@ -1115,12 +1115,12 @@ discard block |
||
| 1115 | 1115 | |
| 1116 | 1116 | if (!empty($projectidforalltimes)) { |
| 1117 | 1117 | // We are on tab 'Time Spent' of project |
| 1118 | - $backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : ''); |
|
| 1119 | - $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
| 1118 | + $backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : ''); |
|
| 1119 | + $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
| 1120 | 1120 | } else { |
| 1121 | 1121 | // We are on tab 'Time Spent' of task |
| 1122 | - $backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : ''); |
|
| 1123 | - $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . ($object->id > 0 ? '&id=' . $object->id : '&projectid=' . $projectstatic->id) . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
| 1122 | + $backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : ''); |
|
| 1123 | + $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
| 1124 | 1124 | } |
| 1125 | 1125 | } else { |
| 1126 | 1126 | $linktocreatetimeBtnStatus = -2; |
@@ -1169,15 +1169,15 @@ discard block |
||
| 1169 | 1169 | $linkback = GETPOST('withproject') ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : ''; |
| 1170 | 1170 | |
| 1171 | 1171 | if ($action == 'deleteline') { |
| 1172 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . $param; |
|
| 1172 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").$param; |
|
| 1173 | 1173 | $formconfirm .= $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
| 1174 | 1174 | } |
| 1175 | 1175 | |
| 1176 | 1176 | if (!GETPOST('withproject') || empty($projectstatic->id)) { |
| 1177 | 1177 | $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); |
| 1178 | - $object->next_prev_filter = "fk_projet:IN:" . $db->sanitize($projectsListId); |
|
| 1178 | + $object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId); |
|
| 1179 | 1179 | } else { |
| 1180 | - $object->next_prev_filter = "fk_projet:=:" . ((int) $projectstatic->id); |
|
| 1180 | + $object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id); |
|
| 1181 | 1181 | } |
| 1182 | 1182 | |
| 1183 | 1183 | $morehtmlref = ''; |
@@ -1185,12 +1185,12 @@ discard block |
||
| 1185 | 1185 | // Project |
| 1186 | 1186 | if (empty($withproject)) { |
| 1187 | 1187 | $morehtmlref .= '<div class="refidno">'; |
| 1188 | - $morehtmlref .= $langs->trans("Project") . ': '; |
|
| 1188 | + $morehtmlref .= $langs->trans("Project").': '; |
|
| 1189 | 1189 | $morehtmlref .= $projectstatic->getNomUrl(1); |
| 1190 | 1190 | $morehtmlref .= '<br>'; |
| 1191 | 1191 | |
| 1192 | 1192 | // Third party |
| 1193 | - $morehtmlref .= $langs->trans("ThirdParty") . ': '; |
|
| 1193 | + $morehtmlref .= $langs->trans("ThirdParty").': '; |
|
| 1194 | 1194 | if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) { |
| 1195 | 1195 | $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); |
| 1196 | 1196 | } |
@@ -1206,7 +1206,7 @@ discard block |
||
| 1206 | 1206 | print '<table class="border centpercent tableforfield">'; |
| 1207 | 1207 | |
| 1208 | 1208 | // Task parent |
| 1209 | - print '<tr><td>' . $langs->trans("ParentTask") . '</td><td>'; |
|
| 1209 | + print '<tr><td>'.$langs->trans("ParentTask").'</td><td>'; |
|
| 1210 | 1210 | if ($object->fk_task_parent > 0) { |
| 1211 | 1211 | $tasktmp = new Task($db); |
| 1212 | 1212 | $tasktmp->fetch($object->fk_task_parent); |
@@ -1215,7 +1215,7 @@ discard block |
||
| 1215 | 1215 | print '</td></tr>'; |
| 1216 | 1216 | |
| 1217 | 1217 | // Date start - Date end task |
| 1218 | - print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>'; |
|
| 1218 | + print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>'; |
|
| 1219 | 1219 | $start = dol_print_date($object->date_start, 'dayhour'); |
| 1220 | 1220 | print($start ? $start : '?'); |
| 1221 | 1221 | $end = dol_print_date($object->date_end, 'dayhour'); |
@@ -1227,7 +1227,7 @@ discard block |
||
| 1227 | 1227 | print '</td></tr>'; |
| 1228 | 1228 | |
| 1229 | 1229 | // Planned workload |
| 1230 | - print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>'; |
|
| 1230 | + print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>'; |
|
| 1231 | 1231 | if ($object->planned_workload) { |
| 1232 | 1232 | print convertSecondToTime($object->planned_workload, 'allhourmin'); |
| 1233 | 1233 | } |
@@ -1242,21 +1242,21 @@ discard block |
||
| 1242 | 1242 | print '<table class="border tableforfield centpercent">'; |
| 1243 | 1243 | |
| 1244 | 1244 | // Progress declared |
| 1245 | - print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>'; |
|
| 1246 | - print $object->progress != '' ? $object->progress . ' %' : ''; |
|
| 1245 | + print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>'; |
|
| 1246 | + print $object->progress != '' ? $object->progress.' %' : ''; |
|
| 1247 | 1247 | print '</td></tr>'; |
| 1248 | 1248 | |
| 1249 | 1249 | // Progress calculated |
| 1250 | - print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>'; |
|
| 1250 | + print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>'; |
|
| 1251 | 1251 | if ($object->planned_workload) { |
| 1252 | 1252 | $tmparray = $object->getSummaryOfTimeSpent(); |
| 1253 | 1253 | if ($tmparray['total_duration'] > 0) { |
| 1254 | - print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %'; |
|
| 1254 | + print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %'; |
|
| 1255 | 1255 | } else { |
| 1256 | 1256 | print '0 %'; |
| 1257 | 1257 | } |
| 1258 | 1258 | } else { |
| 1259 | - print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>'; |
|
| 1259 | + print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>'; |
|
| 1260 | 1260 | } |
| 1261 | 1261 | print '</td>'; |
| 1262 | 1262 | |
@@ -1272,7 +1272,7 @@ discard block |
||
| 1272 | 1272 | print dol_get_fiche_end(); |
| 1273 | 1273 | } else { |
| 1274 | 1274 | if ($action == 'deleteline') { |
| 1275 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($projectstatic->id > 0 ? 'projectid=' . $projectstatic->id : ($object->id > 0 ? "id=" . $object->id : '')) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : ''). "&contextpage=" . urlencode($contextpage).$param; |
|
| 1275 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($projectstatic->id > 0 ? 'projectid='.$projectstatic->id : ($object->id > 0 ? "id=".$object->id : '')).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : '')."&contextpage=".urlencode($contextpage).$param; |
|
| 1276 | 1276 | $formconfirm .= $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
| 1277 | 1277 | } |
| 1278 | 1278 | } |
@@ -1297,10 +1297,10 @@ discard block |
||
| 1297 | 1297 | // Definition of fields for list |
| 1298 | 1298 | $arrayfields = array(); |
| 1299 | 1299 | $arrayfields['t.element_date'] = array('label' => $langs->trans("Date"), 'checked' => '1'); |
| 1300 | - $arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1','checked' => '1'); |
|
| 1300 | + $arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1', 'checked' => '1'); |
|
| 1301 | 1301 | $arrayfields['s.name_alias'] = array('label' => $langs->trans("AliasNameShort"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1'); |
| 1302 | 1302 | if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task |
| 1303 | - if (! empty($allprojectforuser)) { |
|
| 1303 | + if (!empty($allprojectforuser)) { |
|
| 1304 | 1304 | $arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => '1']; |
| 1305 | 1305 | $arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => '1']; |
| 1306 | 1306 | } |
@@ -1316,13 +1316,13 @@ discard block |
||
| 1316 | 1316 | $arrayfields['value'] = array('label' => $langs->trans("Value"), 'checked' => '1', 'enabled' => (string) (int) isModEnabled("salaries")); |
| 1317 | 1317 | $arrayfields['valuebilled'] = array('label' => $langs->trans("Billed"), 'checked' => '1', 'enabled' => (string) (int) (((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time)); |
| 1318 | 1318 | // Extra fields |
| 1319 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
| 1319 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
| 1320 | 1320 | |
| 1321 | 1321 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
| 1322 | 1322 | |
| 1323 | 1323 | $param = ''; |
| 1324 | 1324 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
| 1325 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
| 1325 | + $param .= '&contextpage='.urlencode($contextpage); |
|
| 1326 | 1326 | } |
| 1327 | 1327 | if ($limit > 0 && $limit != $conf->liste_limit) { |
| 1328 | 1328 | $param .= '&limit='.((int) $limit); |
@@ -1331,91 +1331,91 @@ discard block |
||
| 1331 | 1331 | $param .= '&id='.((int) $id); |
| 1332 | 1332 | } |
| 1333 | 1333 | if ($search_month > 0) { |
| 1334 | - $param .= '&search_month=' . urlencode((string) ($search_month)); |
|
| 1334 | + $param .= '&search_month='.urlencode((string) ($search_month)); |
|
| 1335 | 1335 | } |
| 1336 | 1336 | if ($search_year > 0) { |
| 1337 | - $param .= '&search_year=' . urlencode((string) ($search_year)); |
|
| 1337 | + $param .= '&search_year='.urlencode((string) ($search_year)); |
|
| 1338 | 1338 | } |
| 1339 | 1339 | if (!empty($search_user)) { // We keep param if -1 because default value is forced to user id if not set |
| 1340 | 1340 | $param .= '&search_user='.urlencode($search_user); |
| 1341 | 1341 | } |
| 1342 | 1342 | if ($search_task_ref != '') { |
| 1343 | - $param .= '&search_task_ref=' . urlencode($search_task_ref); |
|
| 1343 | + $param .= '&search_task_ref='.urlencode($search_task_ref); |
|
| 1344 | 1344 | } |
| 1345 | 1345 | if ($search_company != '') { |
| 1346 | - $param .= '&search_company=' . urlencode($search_company); |
|
| 1346 | + $param .= '&search_company='.urlencode($search_company); |
|
| 1347 | 1347 | } |
| 1348 | 1348 | if ($search_company_alias != '') { |
| 1349 | - $param .= '&search_company_alias=' . urlencode($search_company_alias); |
|
| 1349 | + $param .= '&search_company_alias='.urlencode($search_company_alias); |
|
| 1350 | 1350 | } |
| 1351 | 1351 | if ($search_project_ref != '') { |
| 1352 | - $param .= '&search_project_ref=' . urlencode($search_project_ref); |
|
| 1352 | + $param .= '&search_project_ref='.urlencode($search_project_ref); |
|
| 1353 | 1353 | } |
| 1354 | 1354 | if ($search_project_label != '') { |
| 1355 | - $param .= '&search_project_label=' . urlencode($search_project_label); |
|
| 1355 | + $param .= '&search_project_label='.urlencode($search_project_label); |
|
| 1356 | 1356 | } |
| 1357 | 1357 | if ($search_task_label != '') { |
| 1358 | - $param .= '&search_task_label=' . urlencode($search_task_label); |
|
| 1358 | + $param .= '&search_task_label='.urlencode($search_task_label); |
|
| 1359 | 1359 | } |
| 1360 | 1360 | if ($search_note != '') { |
| 1361 | - $param .= '&search_note=' . urlencode($search_note); |
|
| 1361 | + $param .= '&search_note='.urlencode($search_note); |
|
| 1362 | 1362 | } |
| 1363 | 1363 | if ($search_duration != '') { |
| 1364 | - $param .= '&search_field2=' . urlencode((string) ($search_duration)); |
|
| 1364 | + $param .= '&search_field2='.urlencode((string) ($search_duration)); |
|
| 1365 | 1365 | } |
| 1366 | 1366 | if ($optioncss != '') { |
| 1367 | - $param .= '&optioncss=' . urlencode($optioncss); |
|
| 1367 | + $param .= '&optioncss='.urlencode($optioncss); |
|
| 1368 | 1368 | } |
| 1369 | 1369 | if ($search_date_startday) { |
| 1370 | - $param .= '&search_date_startday=' . urlencode((string) ($search_date_startday)); |
|
| 1370 | + $param .= '&search_date_startday='.urlencode((string) ($search_date_startday)); |
|
| 1371 | 1371 | } |
| 1372 | 1372 | if ($search_date_startmonth) { |
| 1373 | - $param .= '&search_date_startmonth=' . urlencode((string) ($search_date_startmonth)); |
|
| 1373 | + $param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth)); |
|
| 1374 | 1374 | } |
| 1375 | 1375 | if ($search_date_startyear) { |
| 1376 | - $param .= '&search_date_startyear=' . urlencode((string) ($search_date_startyear)); |
|
| 1376 | + $param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear)); |
|
| 1377 | 1377 | } |
| 1378 | 1378 | if ($search_date_endday) { |
| 1379 | - $param .= '&search_date_endday=' . urlencode((string) ($search_date_endday)); |
|
| 1379 | + $param .= '&search_date_endday='.urlencode((string) ($search_date_endday)); |
|
| 1380 | 1380 | } |
| 1381 | 1381 | if ($search_date_endmonth) { |
| 1382 | - $param .= '&search_date_endmonth=' . urlencode((string) ($search_date_endmonth)); |
|
| 1382 | + $param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth)); |
|
| 1383 | 1383 | } |
| 1384 | 1384 | if ($search_date_endyear) { |
| 1385 | - $param .= '&search_date_endyear=' . urlencode((string) ($search_date_endyear)); |
|
| 1385 | + $param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear)); |
|
| 1386 | 1386 | } |
| 1387 | 1387 | if ($search_timespent_starthour) { |
| 1388 | - $param .= '&search_timespent_duration_starthour=' . urlencode((string) ($search_timespent_starthour)); |
|
| 1388 | + $param .= '&search_timespent_duration_starthour='.urlencode((string) ($search_timespent_starthour)); |
|
| 1389 | 1389 | } |
| 1390 | 1390 | if ($search_timespent_startmin) { |
| 1391 | - $param .= '&search_timespent_duration_startmin=' . urlencode((string) ($search_timespent_startmin)); |
|
| 1391 | + $param .= '&search_timespent_duration_startmin='.urlencode((string) ($search_timespent_startmin)); |
|
| 1392 | 1392 | } |
| 1393 | 1393 | if ($search_timespent_endhour) { |
| 1394 | - $param .= '&search_timespent_duration_endhour=' . urlencode((string) ($search_timespent_endhour)); |
|
| 1394 | + $param .= '&search_timespent_duration_endhour='.urlencode((string) ($search_timespent_endhour)); |
|
| 1395 | 1395 | } |
| 1396 | 1396 | if ($search_timespent_endmin) { |
| 1397 | - $param .= '&search_timespent_duration_endmin=' . urlencode((string) ($search_timespent_endmin)); |
|
| 1397 | + $param .= '&search_timespent_duration_endmin='.urlencode((string) ($search_timespent_endmin)); |
|
| 1398 | 1398 | } |
| 1399 | 1399 | /* |
| 1400 | 1400 | // Add $param from extra fields |
| 1401 | 1401 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
| 1402 | 1402 | */ |
| 1403 | 1403 | if ($projectid) { |
| 1404 | - $param .= '&projectid=' . urlencode((string) ($projectid)); |
|
| 1404 | + $param .= '&projectid='.urlencode((string) ($projectid)); |
|
| 1405 | 1405 | } |
| 1406 | 1406 | if ($withproject) { |
| 1407 | - $param .= '&withproject=' . urlencode((string) ($withproject)); |
|
| 1407 | + $param .= '&withproject='.urlencode((string) ($withproject)); |
|
| 1408 | 1408 | } |
| 1409 | 1409 | // Add $param from hooks |
| 1410 | 1410 | $parameters = array('param' => &$param); |
| 1411 | 1411 | $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 1412 | 1412 | $param .= $hookmanager->resPrint; |
| 1413 | 1413 | |
| 1414 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
| 1414 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
| 1415 | 1415 | if ($optioncss != '') { |
| 1416 | - print '<input type="hidden" name="optioncss" value="' . $optioncss . '">'; |
|
| 1416 | + print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
|
| 1417 | 1417 | } |
| 1418 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 1418 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1419 | 1419 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
| 1420 | 1420 | if ($action == 'editline') { |
| 1421 | 1421 | print '<input type="hidden" name="action" value="updateline">'; |
@@ -1430,12 +1430,12 @@ discard block |
||
| 1430 | 1430 | } else { |
| 1431 | 1431 | print '<input type="hidden" name="action" value="list">'; |
| 1432 | 1432 | } |
| 1433 | - print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
| 1434 | - print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
| 1433 | + print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
| 1434 | + print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
| 1435 | 1435 | |
| 1436 | - print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">'; |
|
| 1437 | - print '<input type="hidden" name="withproject" value="' . $withproject . '">'; |
|
| 1438 | - print '<input type="hidden" name="tab" value="' . $tab . '">'; |
|
| 1436 | + print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">'; |
|
| 1437 | + print '<input type="hidden" name="withproject" value="'.$withproject.'">'; |
|
| 1438 | + print '<input type="hidden" name="tab" value="'.$tab.'">'; |
|
| 1439 | 1439 | print '<input type="hidden" name="page_y" value="">'; |
| 1440 | 1440 | |
| 1441 | 1441 | // Form to convert time spent into invoice |
@@ -1462,7 +1462,7 @@ discard block |
||
| 1462 | 1462 | 'onelineperperiod' => 'OneLinePerTimeSpentLine', |
| 1463 | 1463 | ); |
| 1464 | 1464 | print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1); |
| 1465 | - print "\n" . '<script type="text/javascript">'; |
|
| 1465 | + print "\n".'<script type="text/javascript">'; |
|
| 1466 | 1466 | print ' |
| 1467 | 1467 | $(document).ready(function () { |
| 1468 | 1468 | setDetailVisibility(); |
@@ -1479,8 +1479,8 @@ discard block |
||
| 1479 | 1479 | } |
| 1480 | 1480 | }); |
| 1481 | 1481 | '; |
| 1482 | - print '</script>' . "\n"; |
|
| 1483 | - print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>'; |
|
| 1482 | + print '</script>'."\n"; |
|
| 1483 | + print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>'; |
|
| 1484 | 1484 | print '</td>'; |
| 1485 | 1485 | print '</tr>'; |
| 1486 | 1486 | |
@@ -1530,14 +1530,14 @@ discard block |
||
| 1530 | 1530 | |
| 1531 | 1531 | print '<br>'; |
| 1532 | 1532 | print '<div class="center">'; |
| 1533 | - print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '"> '; |
|
| 1534 | - print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 1533 | + print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'"> '; |
|
| 1534 | + print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 1535 | 1535 | print '</div>'; |
| 1536 | 1536 | print '<br>'; |
| 1537 | 1537 | } else { |
| 1538 | - print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>'; |
|
| 1538 | + print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>'; |
|
| 1539 | 1539 | print '<div class="center">'; |
| 1540 | - print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 1540 | + print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 1541 | 1541 | print '</div>'; |
| 1542 | 1542 | $massaction = ''; |
| 1543 | 1543 | } |
@@ -1550,7 +1550,7 @@ discard block |
||
| 1550 | 1550 | print '<table class="noborder centpercent">'; |
| 1551 | 1551 | print '<tr>'; |
| 1552 | 1552 | print '<td class="titlefield">'; |
| 1553 | - print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse'); |
|
| 1553 | + print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse'); |
|
| 1554 | 1554 | print '</td>'; |
| 1555 | 1555 | print '<td>'; |
| 1556 | 1556 | $forminter = new FormIntervention($db); |
@@ -1560,14 +1560,14 @@ discard block |
||
| 1560 | 1560 | print '</table>'; |
| 1561 | 1561 | |
| 1562 | 1562 | print '<div class="center">'; |
| 1563 | - print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '"> '; |
|
| 1564 | - print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
| 1563 | + print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'"> '; |
|
| 1564 | + print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
| 1565 | 1565 | print '</div>'; |
| 1566 | 1566 | print '<br>'; |
| 1567 | 1567 | } else { |
| 1568 | - print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>'; |
|
| 1568 | + print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>'; |
|
| 1569 | 1569 | print '<div class="center">'; |
| 1570 | - print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
| 1570 | + print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
| 1571 | 1571 | print '</div>'; |
| 1572 | 1572 | $massaction = ''; |
| 1573 | 1573 | } |
@@ -1642,14 +1642,14 @@ discard block |
||
| 1642 | 1642 | $sql .= " AND t.fk_element =".((int) $object->id); |
| 1643 | 1643 | } elseif (!empty($projectidforalltimes)) { |
| 1644 | 1644 | // Limit on one project |
| 1645 | - $sql .= " AND pt.fk_projet IN (" . $db->sanitize((string) $projectidforalltimes) . ")"; |
|
| 1645 | + $sql .= " AND pt.fk_projet IN (".$db->sanitize((string) $projectidforalltimes).")"; |
|
| 1646 | 1646 | } elseif (!empty($allprojectforuser)) { |
| 1647 | 1647 | // Limit on on user |
| 1648 | 1648 | if (empty($search_user) && !empty($arrayfields['author']['checked'])) { |
| 1649 | 1649 | $search_user = $user->id; |
| 1650 | 1650 | } |
| 1651 | 1651 | if ($search_user > 0) { |
| 1652 | - $sql .= " AND t.fk_user = " . ((int) $search_user); |
|
| 1652 | + $sql .= " AND t.fk_user = ".((int) $search_user); |
|
| 1653 | 1653 | } |
| 1654 | 1654 | } |
| 1655 | 1655 | |
@@ -1702,13 +1702,13 @@ discard block |
||
| 1702 | 1702 | if ($search_timespent_starthour || $search_timespent_startmin) { |
| 1703 | 1703 | $timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds |
| 1704 | 1704 | $timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds |
| 1705 | - $sql .= " AND t.element_duration >= " . $timespent_duration_start; |
|
| 1705 | + $sql .= " AND t.element_duration >= ".$timespent_duration_start; |
|
| 1706 | 1706 | } |
| 1707 | 1707 | |
| 1708 | 1708 | if ($search_timespent_endhour || $search_timespent_endmin) { |
| 1709 | 1709 | $timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds |
| 1710 | 1710 | $timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds |
| 1711 | - $sql .= " AND t.element_duration <= " . $timespent_duration_end; |
|
| 1711 | + $sql .= " AND t.element_duration <= ".$timespent_duration_end; |
|
| 1712 | 1712 | } |
| 1713 | 1713 | } |
| 1714 | 1714 | |
@@ -1756,13 +1756,13 @@ discard block |
||
| 1756 | 1756 | |
| 1757 | 1757 | if ($num >= 0) { |
| 1758 | 1758 | if (!empty($projectidforalltimes)) { |
| 1759 | - print '<!-- List of time spent for project -->' . "\n"; |
|
| 1759 | + print '<!-- List of time spent for project -->'."\n"; |
|
| 1760 | 1760 | |
| 1761 | 1761 | $title = $langs->trans("ListTaskTimeUserProject"); |
| 1762 | 1762 | |
| 1763 | 1763 | print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1); |
| 1764 | 1764 | } else { |
| 1765 | - print '<!-- List of time spent -->' . "\n"; |
|
| 1765 | + print '<!-- List of time spent -->'."\n"; |
|
| 1766 | 1766 | |
| 1767 | 1767 | $title = $langs->trans("ListTaskTimeForTask"); |
| 1768 | 1768 | |
@@ -1786,26 +1786,26 @@ discard block |
||
| 1786 | 1786 | * Form to add a new line of time spent |
| 1787 | 1787 | */ |
| 1788 | 1788 | if ($action == 'createtime' && $user->hasRight('projet', 'time')) { |
| 1789 | - print '<!-- table to add time spent -->' . "\n"; |
|
| 1789 | + print '<!-- table to add time spent -->'."\n"; |
|
| 1790 | 1790 | if (!empty($id)) { |
| 1791 | - print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
| 1791 | + print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
| 1792 | 1792 | } |
| 1793 | 1793 | |
| 1794 | 1794 | print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table |
| 1795 | 1795 | print '<table class="noborder nohover centpercent">'; |
| 1796 | 1796 | |
| 1797 | 1797 | print '<tr class="liste_titre">'; |
| 1798 | - print '<td>' . $langs->trans("Date") . '</td>'; |
|
| 1798 | + print '<td>'.$langs->trans("Date").'</td>'; |
|
| 1799 | 1799 | if (!empty($allprojectforuser)) { |
| 1800 | - print '<td>' . $langs->trans("Project") . '</td>'; |
|
| 1800 | + print '<td>'.$langs->trans("Project").'</td>'; |
|
| 1801 | 1801 | } |
| 1802 | 1802 | if (empty($id)) { |
| 1803 | - print '<td>' . $langs->trans("Task") . '</td>'; |
|
| 1803 | + print '<td>'.$langs->trans("Task").'</td>'; |
|
| 1804 | 1804 | } |
| 1805 | - print '<td>' . $langs->trans("By") . '</td>'; |
|
| 1806 | - print '<td>' . $langs->trans("Note") . '</td>'; |
|
| 1807 | - print '<td>' . $langs->trans("NewTimeSpent") . '</td>'; |
|
| 1808 | - print '<td>' . $langs->trans("ProgressDeclared") . '</td>'; |
|
| 1805 | + print '<td>'.$langs->trans("By").'</td>'; |
|
| 1806 | + print '<td>'.$langs->trans("Note").'</td>'; |
|
| 1807 | + print '<td>'.$langs->trans("NewTimeSpent").'</td>'; |
|
| 1808 | + print '<td>'.$langs->trans("ProgressDeclared").'</td>'; |
|
| 1809 | 1809 | if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) { |
| 1810 | 1810 | print '<td></td>'; |
| 1811 | 1811 | |
@@ -1859,14 +1859,14 @@ discard block |
||
| 1859 | 1859 | print $form->select_dolusers((GETPOSTINT('userid') ? GETPOSTINT('userid') : $userid), 'userid', 0, null, 0, '', $contactsofproject, '0', 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200'); |
| 1860 | 1860 | } else { |
| 1861 | 1861 | if ($nboftasks) { |
| 1862 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 1862 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 1863 | 1863 | } |
| 1864 | 1864 | } |
| 1865 | 1865 | print '</td>'; |
| 1866 | 1866 | |
| 1867 | 1867 | // Note |
| 1868 | 1868 | print '<td>'; |
| 1869 | - print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>'; |
|
| 1869 | + print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>'; |
|
| 1870 | 1870 | print '</td>'; |
| 1871 | 1871 | |
| 1872 | 1872 | // Duration - Time spent |
@@ -1940,7 +1940,7 @@ discard block |
||
| 1940 | 1940 | |
| 1941 | 1941 | print '<!-- Liste of time spent -->'."\n"; |
| 1942 | 1942 | print '<div class="div-table-responsive">'; |
| 1943 | - print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
|
| 1943 | + print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; |
|
| 1944 | 1944 | |
| 1945 | 1945 | // Fields title search |
| 1946 | 1946 | // -------------------------------------------------------------------- |
@@ -1965,20 +1965,20 @@ discard block |
||
| 1965 | 1965 | } |
| 1966 | 1966 | // Thirdparty |
| 1967 | 1967 | if (!empty($arrayfields['p.fk_soc']['checked'])) { |
| 1968 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>'; |
|
| 1968 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>'; |
|
| 1969 | 1969 | } |
| 1970 | 1970 | |
| 1971 | 1971 | // Thirdparty alias |
| 1972 | 1972 | if (!empty($arrayfields['s.name_alias']['checked'])) { |
| 1973 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>'; |
|
| 1973 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>'; |
|
| 1974 | 1974 | } |
| 1975 | 1975 | |
| 1976 | 1976 | if (!empty($allprojectforuser)) { |
| 1977 | 1977 | if (!empty($arrayfields['p.project_ref']['checked'])) { |
| 1978 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth125" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>'; |
|
| 1978 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth125" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>'; |
|
| 1979 | 1979 | } |
| 1980 | 1980 | if (!empty($arrayfields['p.project_label']['checked'])) { |
| 1981 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth125" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>'; |
|
| 1981 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth125" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>'; |
|
| 1982 | 1982 | } |
| 1983 | 1983 | } |
| 1984 | 1984 | // Task |
@@ -1996,7 +1996,7 @@ discard block |
||
| 1996 | 1996 | } |
| 1997 | 1997 | // Note |
| 1998 | 1998 | if (!empty($arrayfields['t.note']['checked'])) { |
| 1999 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>'; |
|
| 1999 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>'; |
|
| 2000 | 2000 | } |
| 2001 | 2001 | // Duration |
| 2002 | 2002 | if (!empty($arrayfields['t.element_duration']['checked'])) { |
@@ -2007,7 +2007,7 @@ discard block |
||
| 2007 | 2007 | if ($search_timespent_starthour || $search_timespent_startmin) { |
| 2008 | 2008 | $durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60); |
| 2009 | 2009 | } |
| 2010 | - print '<div class="nowraponall">' . $langs->trans('from') . ' '; |
|
| 2010 | + print '<div class="nowraponall">'.$langs->trans('from').' '; |
|
| 2011 | 2011 | print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1); |
| 2012 | 2012 | print '</div>'; |
| 2013 | 2013 | |
@@ -2015,7 +2015,7 @@ discard block |
||
| 2015 | 2015 | if ($search_timespent_endhour || $search_timespent_endmin) { |
| 2016 | 2016 | $durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60); |
| 2017 | 2017 | } |
| 2018 | - print '<div class="nowraponall">' . $langs->trans('to') . ' '; |
|
| 2018 | + print '<div class="nowraponall">'.$langs->trans('to').' '; |
|
| 2019 | 2019 | print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1); |
| 2020 | 2020 | print '</div>'; |
| 2021 | 2021 | |
@@ -2031,7 +2031,7 @@ discard block |
||
| 2031 | 2031 | } |
| 2032 | 2032 | // Value billed |
| 2033 | 2033 | if (!empty($arrayfields['valuebilled']['checked'])) { |
| 2034 | - print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>'; |
|
| 2034 | + print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>'; |
|
| 2035 | 2035 | } |
| 2036 | 2036 | |
| 2037 | 2037 | /* |
@@ -2049,7 +2049,7 @@ discard block |
||
| 2049 | 2049 | print $searchpicto; |
| 2050 | 2050 | print '</td>'; |
| 2051 | 2051 | } |
| 2052 | - print '</tr>' . "\n"; |
|
| 2052 | + print '</tr>'."\n"; |
|
| 2053 | 2053 | |
| 2054 | 2054 | |
| 2055 | 2055 | $totalarray = array(); |
@@ -2167,9 +2167,9 @@ discard block |
||
| 2167 | 2167 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
| 2168 | 2168 | print '<td class="center nowraponall">'; |
| 2169 | 2169 | if (($action == 'editline' || $action == 'splitline') && GETPOSTINT('lineid') == $task_time->rowid) { |
| 2170 | - print '<input type="hidden" name="lineid" value="' . GETPOSTINT('lineid') . '">'; |
|
| 2170 | + print '<input type="hidden" name="lineid" value="'.GETPOSTINT('lineid').'">'; |
|
| 2171 | 2171 | if ($id) { |
| 2172 | - print '<input type="hidden" name="id" value="' . $id . '">'; // If you enable this, the edit will go beack to task view |
|
| 2172 | + print '<input type="hidden" name="id" value="'.$id.'">'; // If you enable this, the edit will go beack to task view |
|
| 2173 | 2173 | } |
| 2174 | 2174 | print '<input type="submit" class="button buttongen reposition smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">'; |
| 2175 | 2175 | print '<br>'; |
@@ -2181,7 +2181,7 @@ discard block |
||
| 2181 | 2181 | print '</a>'; |
| 2182 | 2182 | |
| 2183 | 2183 | if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) { |
| 2184 | - print '<a class="reposition editfielda paddingleft" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">'; |
|
| 2184 | + print '<a class="reposition editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; |
|
| 2185 | 2185 | print img_split('', 'class="pictofixedwidth paddingleft"'); |
| 2186 | 2186 | print '</a>'; |
| 2187 | 2187 | } |
@@ -2199,12 +2199,12 @@ discard block |
||
| 2199 | 2199 | |
| 2200 | 2200 | // Disable select if task not billable or already invoiced |
| 2201 | 2201 | $disabled = (intval($task_time->billable) != 1 || $invoiced); |
| 2202 | - $ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
| 2202 | + $ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
| 2203 | 2203 | if ($disabled) { |
| 2204 | 2204 | // If disabled, a dbl-click very close outside the control |
| 2205 | 2205 | // will re-enable it, so that user is not blocked if needed. |
| 2206 | - print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>'; |
|
| 2207 | - print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>'; |
|
| 2206 | + print '<span id="cbsp'.$task_time->rowid.'">'.$ctrl.'</span>'; |
|
| 2207 | + print '<script>$("#cbsp'.$task_time->rowid.'").dblclick(()=>{ $("#cb'.$task_time->rowid.'").removeAttr("disabled") })</script>'; |
|
| 2208 | 2208 | } else { |
| 2209 | 2209 | print $ctrl; |
| 2210 | 2210 | } |
@@ -2332,7 +2332,7 @@ discard block |
||
| 2332 | 2332 | } |
| 2333 | 2333 | } |
| 2334 | 2334 | } elseif ($action !== 'createtime') { |
| 2335 | - print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
| 2335 | + print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
| 2336 | 2336 | } |
| 2337 | 2337 | |
| 2338 | 2338 | // Task label |
@@ -2368,9 +2368,9 @@ discard block |
||
| 2368 | 2368 | } |
| 2369 | 2369 | if (count($contactsoftask) > 0) { |
| 2370 | 2370 | print img_object('', 'user', 'class="pictofixedwidth hideonsmartphone"'); |
| 2371 | - print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'minwidth100 maxwidth100'); // maxwidth must be lowed than minwidth of the td |
|
| 2371 | + print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'minwidth100 maxwidth100'); // maxwidth must be lowed than minwidth of the td |
|
| 2372 | 2372 | } else { |
| 2373 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2373 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2374 | 2374 | } |
| 2375 | 2375 | } else { |
| 2376 | 2376 | $userstatic->id = $task_time->fk_user; |
@@ -2392,7 +2392,7 @@ discard block |
||
| 2392 | 2392 | if (!empty($arrayfields['t.note']['checked'])) { |
| 2393 | 2393 | if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) { |
| 2394 | 2394 | print '<td class="small">'; |
| 2395 | - print '<textarea name="timespent_note_line" class="centpercentimp" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
| 2395 | + print '<textarea name="timespent_note_line" class="centpercentimp" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
| 2396 | 2396 | print '</td>'; |
| 2397 | 2397 | } else { |
| 2398 | 2398 | print '<td class="small tdoverflowmax150 classfortooltip" title="'.dol_string_onlythesehtmltags(dol_htmlentitiesbr($task_time->note)).'">'; |
@@ -2403,7 +2403,7 @@ discard block |
||
| 2403 | 2403 | $totalarray['nbfield']++; |
| 2404 | 2404 | } |
| 2405 | 2405 | } elseif ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) { |
| 2406 | - print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
| 2406 | + print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
| 2407 | 2407 | } |
| 2408 | 2408 | |
| 2409 | 2409 | // Time spent |
@@ -2464,7 +2464,7 @@ discard block |
||
| 2464 | 2464 | $value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1); |
| 2465 | 2465 | |
| 2466 | 2466 | print '<td class="nowraponall right">'; |
| 2467 | - print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">'; |
|
| 2467 | + print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">'; |
|
| 2468 | 2468 | print price($value, 1, $langs, 1, -1, -1, $conf->currency); |
| 2469 | 2469 | print '</span>'; |
| 2470 | 2470 | print '</td>'; |
@@ -2521,7 +2521,7 @@ discard block |
||
| 2521 | 2521 | } |
| 2522 | 2522 | } |
| 2523 | 2523 | } else { |
| 2524 | - print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>'; |
|
| 2524 | + print '<span class="opacitymedium">'.$langs->trans("NA").'</span>'; |
|
| 2525 | 2525 | } |
| 2526 | 2526 | } |
| 2527 | 2527 | print '</td>'; |
@@ -2555,7 +2555,7 @@ discard block |
||
| 2555 | 2555 | print '</a>'; |
| 2556 | 2556 | |
| 2557 | 2557 | if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) { |
| 2558 | - print '<a class="reposition editfielda paddingleft" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">'; |
|
| 2558 | + print '<a class="reposition editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; |
|
| 2559 | 2559 | print img_split('', 'class="pictofixedwidth paddingleft"'); |
| 2560 | 2560 | print '</a>'; |
| 2561 | 2561 | } |
@@ -2573,12 +2573,12 @@ discard block |
||
| 2573 | 2573 | |
| 2574 | 2574 | // Disable select if task not billable or already invoiced |
| 2575 | 2575 | $disabled = (intval($task_time->billable) != 1 || $invoiced); |
| 2576 | - $ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
| 2576 | + $ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
| 2577 | 2577 | if ($disabled) { |
| 2578 | 2578 | // If disabled, a dbl-click very close outside the control |
| 2579 | 2579 | // will re-enable it, so that user is not blocked if needed. |
| 2580 | - print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>'; |
|
| 2581 | - print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>'; |
|
| 2580 | + print '<span id="cbsp'.$task_time->rowid.'">'.$ctrl.'</span>'; |
|
| 2581 | + print '<script>$("#cbsp'.$task_time->rowid.'").dblclick(()=>{ $("#cb'.$task_time->rowid.'").removeAttr("disabled") })</script>'; |
|
| 2582 | 2582 | } else { |
| 2583 | 2583 | print $ctrl; |
| 2584 | 2584 | } |
@@ -2677,7 +2677,7 @@ discard block |
||
| 2677 | 2677 | print img_object('', 'user', 'class="hideonsmartphone"'); |
| 2678 | 2678 | print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask); |
| 2679 | 2679 | } else { |
| 2680 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2680 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2681 | 2681 | } |
| 2682 | 2682 | } else { |
| 2683 | 2683 | $userstatic->id = $task_time->fk_user; |
@@ -2694,13 +2694,13 @@ discard block |
||
| 2694 | 2694 | if (!empty($arrayfields['t.note']['checked'])) { |
| 2695 | 2695 | print '<td class="tdoverflowmax300">'; |
| 2696 | 2696 | if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
| 2697 | - print '<textarea name="timespent_note_line" class="centpercentimp" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
| 2697 | + print '<textarea name="timespent_note_line" class="centpercentimp" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
| 2698 | 2698 | } else { |
| 2699 | 2699 | print dol_nl2br($task_time->note); |
| 2700 | 2700 | } |
| 2701 | 2701 | print '</td>'; |
| 2702 | 2702 | } elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
| 2703 | - print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_2 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
| 2703 | + print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_2.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
| 2704 | 2704 | } |
| 2705 | 2705 | |
| 2706 | 2706 | // Time spent |
@@ -2842,7 +2842,7 @@ discard block |
||
| 2842 | 2842 | print img_object('', 'user', 'class="hideonsmartphone"'); |
| 2843 | 2843 | print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, null, 0, '', $contactsoftask); |
| 2844 | 2844 | } else { |
| 2845 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2845 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2846 | 2846 | } |
| 2847 | 2847 | } else { |
| 2848 | 2848 | $userstatic->id = $task_time->fk_user; |
@@ -2859,13 +2859,13 @@ discard block |
||
| 2859 | 2859 | if (!empty($arrayfields['t.note']['checked'])) { |
| 2860 | 2860 | print '<td class="small tdoverflowmax300"">'; |
| 2861 | 2861 | if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
| 2862 | - print '<textarea name="timespent_note_line_2" class="centpercentimp" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
| 2862 | + print '<textarea name="timespent_note_line_2" class="centpercentimp" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
| 2863 | 2863 | } else { |
| 2864 | 2864 | print dol_nl2br($task_time->note); |
| 2865 | 2865 | } |
| 2866 | 2866 | print '</td>'; |
| 2867 | 2867 | } elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
| 2868 | - print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
| 2868 | + print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
| 2869 | 2869 | } |
| 2870 | 2870 | |
| 2871 | 2871 | // Time spent |
@@ -2940,14 +2940,14 @@ discard block |
||
| 2940 | 2940 | $i++; |
| 2941 | 2941 | if ($i == 1) { |
| 2942 | 2942 | if ($num < $limit && empty($offset)) { |
| 2943 | - print '<td class="left">' . $langs->trans("Total") . '</td>'; |
|
| 2943 | + print '<td class="left">'.$langs->trans("Total").'</td>'; |
|
| 2944 | 2944 | } else { |
| 2945 | 2945 | print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>'; |
| 2946 | 2946 | } |
| 2947 | 2947 | } elseif (isset($totalarray['totaldurationfield']) && $totalarray['totaldurationfield'] == $i) { |
| 2948 | - print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>'; |
|
| 2948 | + print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>'; |
|
| 2949 | 2949 | } elseif (isset($totalarray['totalvaluefield']) && $totalarray['totalvaluefield'] == $i) { |
| 2950 | - print '<td class="right">' . price($totalarray['totalvalue']) . '</td>'; |
|
| 2950 | + print '<td class="right">'.price($totalarray['totalvalue']).'</td>'; |
|
| 2951 | 2951 | //} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>'; |
| 2952 | 2952 | } else { |
| 2953 | 2953 | print '<td></td>'; |
@@ -2963,8 +2963,8 @@ discard block |
||
| 2963 | 2963 | $totalnboffields++; |
| 2964 | 2964 | } |
| 2965 | 2965 | } |
| 2966 | - print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">'; |
|
| 2967 | - print '<span class="opacitymedium">' . $langs->trans("None") . '</span>'; |
|
| 2966 | + print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">'; |
|
| 2967 | + print '<span class="opacitymedium">'.$langs->trans("None").'</span>'; |
|
| 2968 | 2968 | print '</td></tr>'; |
| 2969 | 2969 | } |
| 2970 | 2970 | |
@@ -687,7 +687,7 @@ |
||
| 687 | 687 | } else { |
| 688 | 688 | $datestart = dol_time_plus_duree($dateend, -1, 'd', 'gmt'); |
| 689 | 689 | } |
| 690 | - $datestart += 1; // Add 1 second |
|
| 690 | + $datestart += 1; // Add 1 second |
|
| 691 | 691 | |
| 692 | 692 | //print ' '; |
| 693 | 693 | $htmltooltip = ''; |
@@ -91,14 +91,14 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | // General $Variables |
| 94 | -$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility |
|
| 94 | +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility |
|
| 95 | 95 | $ref = GETPOST('ref', 'alpha'); |
| 96 | 96 | $socid = GETPOSTINT('socid'); |
| 97 | 97 | $action = GETPOST('action', 'aZ09'); |
| 98 | 98 | $confirm = GETPOST('confirm', 'alpha'); |
| 99 | 99 | $cancel = GETPOST('cancel', 'alpha'); |
| 100 | -$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
| 101 | -$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 100 | +$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
| 101 | +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 102 | 102 | $lineid = GETPOSTINT('lineid'); |
| 103 | 103 | $origin = GETPOST('origin', 'alpha'); |
| 104 | 104 | $originid = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | setEventMessages('', $warningMsgLineList, 'warnings'); |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | - header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $result); |
|
| 270 | + header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$result); |
|
| 271 | 271 | exit(); |
| 272 | 272 | } else { |
| 273 | 273 | $langs->load("errors"); |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | // Validation |
| 393 | 393 | $object->fetch($id); |
| 394 | 394 | |
| 395 | - if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) && // empty should not happened, but when it occurs, the test save life |
|
| 395 | + if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) && // empty should not happened, but when it occurs, the test save life |
|
| 396 | 396 | getDolGlobalString('FAC_FORCE_DATE_VALIDATION') // If option enabled, we force invoice date |
| 397 | 397 | ) { |
| 398 | 398 | $object->date = dol_now(); |
@@ -834,8 +834,8 @@ discard block |
||
| 834 | 834 | // We check if invoice has payments |
| 835 | 835 | $totalpaid = 0; |
| 836 | 836 | $sql = 'SELECT pf.amount'; |
| 837 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'paiement_facture as pf'; |
|
| 838 | - $sql .= ' WHERE pf.fk_facture = ' . ((int) $object->id); |
|
| 837 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf'; |
|
| 838 | + $sql .= ' WHERE pf.fk_facture = '.((int) $object->id); |
|
| 839 | 839 | |
| 840 | 840 | $result = $db->query($sql); |
| 841 | 841 | if ($result) { |
@@ -911,7 +911,7 @@ discard block |
||
| 911 | 911 | $tempTva->datev = $object->date; |
| 912 | 912 | $tempTva->datep = $object->date; |
| 913 | 913 | $tempTva->amount = $amount; |
| 914 | - $tempTva->label = $langs->trans('WithholdingTax') . ' - ' . $object->ref; |
|
| 914 | + $tempTva->label = $langs->trans('WithholdingTax').' - '.$object->ref; |
|
| 915 | 915 | //$tempTva->paye = 1; |
| 916 | 916 | $valid = $tempTva->getIdForLabel($tempTva->label); |
| 917 | 917 | if (!$valid) { |
@@ -939,7 +939,7 @@ discard block |
||
| 939 | 939 | if ($result < 0) { |
| 940 | 940 | setEventMessages($object->error, $object->errors, 'errors'); |
| 941 | 941 | } else { |
| 942 | - $object->fetch($object->id); // Reload properties |
|
| 942 | + $object->fetch($object->id); // Reload properties |
|
| 943 | 943 | } |
| 944 | 944 | } |
| 945 | 945 | } else { |
@@ -955,7 +955,7 @@ discard block |
||
| 955 | 955 | if ($result < 0) { |
| 956 | 956 | setEventMessages($object->error, $object->errors, 'errors'); |
| 957 | 957 | } else { |
| 958 | - $object->fetch($object->id); // Reload properties |
|
| 958 | + $object->fetch($object->id); // Reload properties |
|
| 959 | 959 | } |
| 960 | 960 | } else { |
| 961 | 961 | setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors'); |
@@ -1156,7 +1156,7 @@ discard block |
||
| 1156 | 1156 | // Set invoice as paid |
| 1157 | 1157 | $result = $object->setPaid($user); |
| 1158 | 1158 | if ($result >= 0) { |
| 1159 | - $object->fetch($object->id); // Reload properties |
|
| 1159 | + $object->fetch($object->id); // Reload properties |
|
| 1160 | 1160 | $db->commit(); |
| 1161 | 1161 | } else { |
| 1162 | 1162 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -1207,7 +1207,7 @@ discard block |
||
| 1207 | 1207 | $error++; |
| 1208 | 1208 | } |
| 1209 | 1209 | |
| 1210 | - $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 1210 | + $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 1211 | 1211 | $date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver'); |
| 1212 | 1212 | |
| 1213 | 1213 | // Replacement invoice |
@@ -1239,7 +1239,7 @@ discard block |
||
| 1239 | 1239 | $object->note_private = trim(GETPOST('note_private', 'restricthtml')); |
| 1240 | 1240 | $object->ref_client = GETPOST('ref_client', 'alphanohtml'); |
| 1241 | 1241 | $object->ref_customer = GETPOST('ref_client', 'alphanohtml'); |
| 1242 | - $object->model_pdf = GETPOST('model', 'alphanohtml'); |
|
| 1242 | + $object->model_pdf = GETPOST('model', 'alphanohtml'); |
|
| 1243 | 1243 | $object->fk_project = GETPOSTINT('projectid'); |
| 1244 | 1244 | $object->cond_reglement_id = GETPOSTINT('cond_reglement_id'); |
| 1245 | 1245 | $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
@@ -1300,9 +1300,9 @@ discard block |
||
| 1300 | 1300 | $object->note_private = trim(GETPOST('note_private', 'restricthtml')); |
| 1301 | 1301 | $object->ref_client = GETPOST('ref_client', 'alphanohtml'); |
| 1302 | 1302 | $object->ref_customer = GETPOST('ref_client', 'alphanohtml'); |
| 1303 | - $object->model_pdf = GETPOST('model'); |
|
| 1303 | + $object->model_pdf = GETPOST('model'); |
|
| 1304 | 1304 | $object->fk_project = GETPOSTINT('projectid'); |
| 1305 | - $object->cond_reglement_id = 0; // No payment term for a credit note |
|
| 1305 | + $object->cond_reglement_id = 0; // No payment term for a credit note |
|
| 1306 | 1306 | $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
| 1307 | 1307 | $object->fk_account = GETPOSTINT('fk_account'); |
| 1308 | 1308 | //$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU'); |
@@ -1629,7 +1629,7 @@ discard block |
||
| 1629 | 1629 | $object->note_public = trim(GETPOST('note_public', 'restricthtml')); |
| 1630 | 1630 | $object->note_private = trim(GETPOST('note_private', 'restricthtml')); |
| 1631 | 1631 | $object->ref_client = GETPOST('ref_client'); |
| 1632 | - $object->ref_customer = GETPOST('ref_client'); |
|
| 1632 | + $object->ref_customer = GETPOST('ref_client'); |
|
| 1633 | 1633 | $object->model_pdf = GETPOST('model'); |
| 1634 | 1634 | $object->fk_project = GETPOSTINT('projectid'); |
| 1635 | 1635 | $object->cond_reglement_id = (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id')); |
@@ -1693,7 +1693,7 @@ discard block |
||
| 1693 | 1693 | $element = $subelement = 'expedition'; |
| 1694 | 1694 | } |
| 1695 | 1695 | |
| 1696 | - $object->origin = $origin; // deprecated |
|
| 1696 | + $object->origin = $origin; // deprecated |
|
| 1697 | 1697 | $object->origin_type = $origin; |
| 1698 | 1698 | $object->origin_id = $originid; |
| 1699 | 1699 | |
@@ -1728,7 +1728,7 @@ discard block |
||
| 1728 | 1728 | dol_syslog("Try to find source object origin_type=".$object->origin_type." origin_id=".$object->origin_id." to add lines or deposit lines"); |
| 1729 | 1729 | $result = $srcobject->fetch($object->origin_id); |
| 1730 | 1730 | |
| 1731 | - $i = -1; // Ensure initialised for static analysis, but with invalid idx. |
|
| 1731 | + $i = -1; // Ensure initialised for static analysis, but with invalid idx. |
|
| 1732 | 1732 | // If deposit invoice - down payment with 1 line (fixed amount or percent) |
| 1733 | 1733 | if (GETPOST('type') == Facture::TYPE_DEPOSIT && in_array($typeamount, array('amount', 'variable'))) { |
| 1734 | 1734 | // Define the array $amountdeposit |
@@ -2153,7 +2153,7 @@ discard block |
||
| 2153 | 2153 | if (!empty($origin) && !empty($originid)) { |
| 2154 | 2154 | include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; |
| 2155 | 2155 | |
| 2156 | - $object->origin = $origin; // deprecated |
|
| 2156 | + $object->origin = $origin; // deprecated |
|
| 2157 | 2157 | $object->origin_type = $origin; |
| 2158 | 2158 | $object->origin_id = $originid; |
| 2159 | 2159 | |
@@ -2179,7 +2179,7 @@ discard block |
||
| 2179 | 2179 | $line->fk_prev_id = $line->id; |
| 2180 | 2180 | $line->fetch_optionals(); |
| 2181 | 2181 | if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { |
| 2182 | - $line->situation_percent = 0; // New situation percent must be 0 (No cumulative) |
|
| 2182 | + $line->situation_percent = 0; // New situation percent must be 0 (No cumulative) |
|
| 2183 | 2183 | } else { |
| 2184 | 2184 | $line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note |
| 2185 | 2185 | } |
@@ -2296,7 +2296,7 @@ discard block |
||
| 2296 | 2296 | } else { |
| 2297 | 2297 | $db->rollback(); |
| 2298 | 2298 | $action = 'create'; |
| 2299 | - $_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ? |
|
| 2299 | + $_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ? |
|
| 2300 | 2300 | $_GET["originid"] = $_POST["originid"]; // Keep GET and POST here ? |
| 2301 | 2301 | setEventMessages($object->error, $object->errors, 'errors'); |
| 2302 | 2302 | } |
@@ -2762,7 +2762,7 @@ discard block |
||
| 2762 | 2762 | */ |
| 2763 | 2763 | |
| 2764 | 2764 | // Margin |
| 2765 | - $fournprice = (int) (GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only |
|
| 2765 | + $fournprice = (int) (GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only |
|
| 2766 | 2766 | $buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value |
| 2767 | 2767 | |
| 2768 | 2768 | |
@@ -2900,7 +2900,7 @@ discard block |
||
| 2900 | 2900 | if ($prod->price_min > $line->subprice) { |
| 2901 | 2901 | $price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto'); |
| 2902 | 2902 | $price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto'); |
| 2903 | - setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings'); |
|
| 2903 | + setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings'); |
|
| 2904 | 2904 | } else { |
| 2905 | 2905 | setEventMessages($prod->error, $prod->errors, 'errors'); |
| 2906 | 2906 | } |
@@ -3051,7 +3051,7 @@ discard block |
||
| 3051 | 3051 | $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty); |
| 3052 | 3052 | |
| 3053 | 3053 | // Add buying price |
| 3054 | - $fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only |
|
| 3054 | + $fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only |
|
| 3055 | 3055 | $buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we must keep this value |
| 3056 | 3056 | |
| 3057 | 3057 | // Prepare a price equivalent for minimum price check |
@@ -3094,7 +3094,7 @@ discard block |
||
| 3094 | 3094 | // Define special_code for special lines |
| 3095 | 3095 | $special_code = GETPOSTINT('special_code'); |
| 3096 | 3096 | if ($special_code == 3) { |
| 3097 | - $special_code = 0; // Options should not exists on invoices |
|
| 3097 | + $special_code = 0; // Options should not exists on invoices |
|
| 3098 | 3098 | } |
| 3099 | 3099 | |
| 3100 | 3100 | $line = new FactureLigne($db); |
@@ -3548,7 +3548,7 @@ discard block |
||
| 3548 | 3548 | |
| 3549 | 3549 | |
| 3550 | 3550 | if ($action == 'update_extras' && $permissiontoeditextra) { |
| 3551 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 3551 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 3552 | 3552 | |
| 3553 | 3553 | $attribute_name = GETPOST('attribute', 'aZ09'); |
| 3554 | 3554 | |
@@ -3664,13 +3664,13 @@ discard block |
||
| 3664 | 3664 | $mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
| 3665 | 3665 | $fk_account = GETPOSTINT('fk_account'); |
| 3666 | 3666 | |
| 3667 | - $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 3667 | + $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 3668 | 3668 | if (empty($dateinvoice)) { |
| 3669 | - $dateinvoice = (getDolGlobalString('MAIN_DO_NOT_AUTOFILL_DATE_INVOICE') ? -1 : ''); // By default '' so we will autofill date. -1 means keep empty. |
|
| 3669 | + $dateinvoice = (getDolGlobalString('MAIN_DO_NOT_AUTOFILL_DATE_INVOICE') ? -1 : ''); // By default '' so we will autofill date. -1 means keep empty. |
|
| 3670 | 3670 | } |
| 3671 | 3671 | |
| 3672 | 3672 | // Load objectsrc |
| 3673 | - $objectsrc = null; // Initialise |
|
| 3673 | + $objectsrc = null; // Initialise |
|
| 3674 | 3674 | //$remise_absolue = 0; |
| 3675 | 3675 | if (!empty($origin) && !empty($originid)) { |
| 3676 | 3676 | // Parse element/subelement (ex: project_task) |
@@ -3754,8 +3754,8 @@ discard block |
||
| 3754 | 3754 | $fk_account = (!empty($expesrc->fk_account) ? $expesrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0)); |
| 3755 | 3755 | |
| 3756 | 3756 | if (isModEnabled('multicurrency')) { |
| 3757 | - $currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code)); |
|
| 3758 | - $currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx)); |
|
| 3757 | + $currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code)); |
|
| 3758 | + $currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx)); |
|
| 3759 | 3759 | } |
| 3760 | 3760 | |
| 3761 | 3761 | // replicate input reason |
@@ -3853,7 +3853,7 @@ discard block |
||
| 3853 | 3853 | print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">'; |
| 3854 | 3854 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
| 3855 | 3855 | print '<input type="hidden" name="action" id="formtocreateaction" value="add">'; |
| 3856 | - print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 3856 | + print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 3857 | 3857 | if ($soc->id > 0) { |
| 3858 | 3858 | print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n"; |
| 3859 | 3859 | } |
@@ -4042,7 +4042,7 @@ discard block |
||
| 4042 | 4042 | print $form->selectarray('typestandard', $arraylist, GETPOST('typestandard', 'aZ09'), 0, 0, 0, '', 1); |
| 4043 | 4043 | print '</td>';*/ |
| 4044 | 4044 | if (!getDolGlobalInt('INVOICE_DEPOSIT_INVOICE_ONLY_SAME_LINES')) { |
| 4045 | - print '<span class="opacitymedium marginleftonly">' . $langs->trans('PercentOfOriginalObject') . '</span>:<input class="right" placeholder="100%" type="text" id="valuestandardinvoice" name="valuestandardinvoice" size="3" value="' . (GETPOSTISSET('valuestandardinvoice') ? GETPOST('valuestandardinvoice', 'alpha') : '100%') . '"/>'; |
|
| 4045 | + print '<span class="opacitymedium marginleftonly">'.$langs->trans('PercentOfOriginalObject').'</span>:<input class="right" placeholder="100%" type="text" id="valuestandardinvoice" name="valuestandardinvoice" size="3" value="'.(GETPOSTISSET('valuestandardinvoice') ? GETPOST('valuestandardinvoice', 'alpha') : '100%').'"/>'; |
|
| 4046 | 4046 | } |
| 4047 | 4047 | } |
| 4048 | 4048 | print '</div></div>'."\n"; |
@@ -4397,8 +4397,8 @@ discard block |
||
| 4397 | 4397 | if ($socid > 0) { |
| 4398 | 4398 | print '<tr><td>'.$langs->trans('DiscountStillRemaining').'</td><td colspan="2">'; |
| 4399 | 4399 | |
| 4400 | - $thirdparty = $soc; // used by object_discounts.tpl.php |
|
| 4401 | - $discount_type = 0; // used by object_discounts.tpl.php |
|
| 4400 | + $thirdparty = $soc; // used by object_discounts.tpl.php |
|
| 4401 | + $discount_type = 0; // used by object_discounts.tpl.php |
|
| 4402 | 4402 | $backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid'))); |
| 4403 | 4403 | |
| 4404 | 4404 | // loading object_discounts.tpl.php from module core/tpl if exists |
@@ -4458,7 +4458,7 @@ discard block |
||
| 4458 | 4458 | if (empty($retained_warranty)) { |
| 4459 | 4459 | if ($objectsrc !== null && property_exists($objectsrc, 'retained_warranty') && !empty($objectsrc->retained_warranty)) { // use previous situation value |
| 4460 | 4460 | // Facture->retained_warranty (does not exist on Expedition) |
| 4461 | - $retained_warranty = $objectsrc->retained_warranty; // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 4461 | + $retained_warranty = $objectsrc->retained_warranty; // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 4462 | 4462 | } |
| 4463 | 4463 | } |
| 4464 | 4464 | $retained_warranty_js_default = !empty($retained_warranty) ? $retained_warranty : getDolGlobalString('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT'); |
@@ -4971,7 +4971,7 @@ discard block |
||
| 4971 | 4971 | $nbMandated = 0; |
| 4972 | 4972 | foreach ($object->lines as $line) { |
| 4973 | 4973 | $res = $line->fetch_product(); |
| 4974 | - if ($res > 0) { |
|
| 4974 | + if ($res > 0) { |
|
| 4975 | 4975 | if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) { |
| 4976 | 4976 | $nbMandated++; |
| 4977 | 4977 | break; |
@@ -5214,7 +5214,7 @@ discard block |
||
| 5214 | 5214 | } |
| 5215 | 5215 | // Ref customer |
| 5216 | 5216 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string', '', 0, 1); |
| 5217 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 5217 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 5218 | 5218 | // Thirdparty |
| 5219 | 5219 | $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer'); |
| 5220 | 5220 | if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) { |
@@ -5346,7 +5346,7 @@ discard block |
||
| 5346 | 5346 | print '</td><td class="valuefield fieldname_type">'; |
| 5347 | 5347 | print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" name="formposinfo">'; |
| 5348 | 5348 | print '<input type="hidden" name="action" value="setposinfo">'; |
| 5349 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5349 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5350 | 5350 | if ($action == 'editposinfo') { |
| 5351 | 5351 | print '<input type="text" class="maxwidth150" name="posmodule" placeholder="'.$langs->trans("POSModule").'" value="'.$object->module_source.'"> '; |
| 5352 | 5352 | print '<input type="text" class="maxwidth100" name="posterminal" placeholder="'.$langs->trans("Terminal").'" value="'.$object->pos_source.'">'; |
@@ -5711,45 +5711,45 @@ discard block |
||
| 5711 | 5711 | } |
| 5712 | 5712 | print '<tr>'; |
| 5713 | 5713 | // Amount HT |
| 5714 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
| 5715 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5714 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
| 5715 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5716 | 5716 | if (isModEnabled("multicurrency") && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { |
| 5717 | 5717 | // Multicurrency Amount HT |
| 5718 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5718 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5719 | 5719 | } |
| 5720 | 5720 | print '</tr>'; |
| 5721 | 5721 | |
| 5722 | 5722 | print '<tr>'; |
| 5723 | 5723 | // Amount VAT |
| 5724 | - print '<td>' . $langs->trans('AmountVAT') . '</td>'; |
|
| 5725 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5724 | + print '<td>'.$langs->trans('AmountVAT').'</td>'; |
|
| 5725 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5726 | 5726 | if (isModEnabled("multicurrency") && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { |
| 5727 | 5727 | // Multicurrency Amount VAT |
| 5728 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5728 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5729 | 5729 | } |
| 5730 | 5730 | print '</tr>'; |
| 5731 | 5731 | |
| 5732 | 5732 | // Amount Local Taxes |
| 5733 | 5733 | if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) { |
| 5734 | 5734 | print '<tr>'; |
| 5735 | - print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
| 5736 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5735 | + print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
| 5736 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5737 | 5737 | if (isModEnabled("multicurrency") && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { |
| 5738 | 5738 | $object->multicurrency_total_localtax1 = (float) price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); |
| 5739 | 5739 | |
| 5740 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5740 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5741 | 5741 | } |
| 5742 | 5742 | print '</tr>'; |
| 5743 | 5743 | } |
| 5744 | 5744 | |
| 5745 | 5745 | if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) { |
| 5746 | 5746 | print '<tr>'; |
| 5747 | - print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
| 5748 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5747 | + print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
| 5748 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5749 | 5749 | if (isModEnabled("multicurrency") && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { |
| 5750 | 5750 | $object->multicurrency_total_localtax2 = (float) price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); |
| 5751 | 5751 | |
| 5752 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5752 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5753 | 5753 | } |
| 5754 | 5754 | print '</tr>'; |
| 5755 | 5755 | } |
@@ -5809,11 +5809,11 @@ discard block |
||
| 5809 | 5809 | |
| 5810 | 5810 | print '<tr>'; |
| 5811 | 5811 | // Amount TTC |
| 5812 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
| 5813 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5812 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
| 5813 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5814 | 5814 | if (isModEnabled("multicurrency") && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { |
| 5815 | 5815 | // Multicurrency Amount TTC |
| 5816 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5816 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5817 | 5817 | } |
| 5818 | 5818 | print '</tr>'; |
| 5819 | 5819 | |
@@ -6097,7 +6097,7 @@ discard block |
||
| 6097 | 6097 | if ($object->type != Facture::TYPE_CREDIT_NOTE) { |
| 6098 | 6098 | // Total already paid |
| 6099 | 6099 | print '<tr>'; |
| 6100 | - print '<td colspan="'.($nbcols+1).'" class="right">'; |
|
| 6100 | + print '<td colspan="'.($nbcols + 1).'" class="right">'; |
|
| 6101 | 6101 | print '<span class="opacitymedium">'; |
| 6102 | 6102 | if ($object->type != Facture::TYPE_DEPOSIT) { |
| 6103 | 6103 | print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits'); |
@@ -6179,7 +6179,7 @@ discard block |
||
| 6179 | 6179 | // Partially paid or abandoned 'badcustomer' |
| 6180 | 6180 | if (($object->status == Facture::STATUS_CLOSED || $object->status == Facture::STATUS_ABANDONED) && $object->close_code == 'badcustomer') { |
| 6181 | 6181 | print '<tr>'; |
| 6182 | - print '<td colspan="'.($nbcols+1).'" class="nowrap right">'; |
|
| 6182 | + print '<td colspan="'.($nbcols + 1).'" class="nowrap right">'; |
|
| 6183 | 6183 | print '<span class="opacitymedium">'; |
| 6184 | 6184 | print $form->textwithpicto($langs->trans("Abandoned"), $langs->trans("HelpAbandonBadCustomer"), - 1); |
| 6185 | 6185 | print '</span>'; |
@@ -6194,7 +6194,7 @@ discard block |
||
| 6194 | 6194 | // Partially paid or abandoned 'product_returned' |
| 6195 | 6195 | if (($object->status == Facture::STATUS_CLOSED || $object->status == Facture::STATUS_ABANDONED) && $object->close_code == 'product_returned') { |
| 6196 | 6196 | print '<tr>'; |
| 6197 | - print '<td colspan="'.($nbcols+1).'" class="nowrap right">'; |
|
| 6197 | + print '<td colspan="'.($nbcols + 1).'" class="nowrap right">'; |
|
| 6198 | 6198 | print '<span class="opacitymedium">'; |
| 6199 | 6199 | print $form->textwithpicto($langs->trans("ProductReturned"), $langs->trans("HelpAbandonProductReturned"), - 1); |
| 6200 | 6200 | print '</span>'; |
@@ -6209,7 +6209,7 @@ discard block |
||
| 6209 | 6209 | // Partially paid or abandoned 'abandoned' |
| 6210 | 6210 | if (($object->status == Facture::STATUS_CLOSED || $object->status == Facture::STATUS_ABANDONED) && $object->close_code == 'abandon') { |
| 6211 | 6211 | print '<tr>'; |
| 6212 | - print '<td colspan="'.($nbcols+1).'" class="nowrap right">'; |
|
| 6212 | + print '<td colspan="'.($nbcols + 1).'" class="nowrap right">'; |
|
| 6213 | 6213 | $text = $langs->trans("HelpAbandonOther"); |
| 6214 | 6214 | if ($object->close_note) { |
| 6215 | 6215 | $text .= '<br><br><b>'.$langs->trans("Reason").'</b>:'.$object->close_note; |
@@ -6229,7 +6229,7 @@ discard block |
||
| 6229 | 6229 | |
| 6230 | 6230 | // Billed |
| 6231 | 6231 | print '<tr>'; |
| 6232 | - print '<td colspan="'.($nbcols+1).'" class="right">'; |
|
| 6232 | + print '<td colspan="'.($nbcols + 1).'" class="right">'; |
|
| 6233 | 6233 | print '<span class="opacitymedium">'; |
| 6234 | 6234 | print $langs->trans("Billed"); |
| 6235 | 6235 | print '</td>'; |
@@ -6239,7 +6239,7 @@ discard block |
||
| 6239 | 6239 | |
| 6240 | 6240 | // Remainder to pay |
| 6241 | 6241 | print '<tr>'; |
| 6242 | - print '<td colspan="'.($nbcols+1).'" class="right">'; |
|
| 6242 | + print '<td colspan="'.($nbcols + 1).'" class="right">'; |
|
| 6243 | 6243 | print '<span class="opacitymedium">'; |
| 6244 | 6244 | print $langs->trans('RemainderToPay'); |
| 6245 | 6245 | if ($resteapayeraffiche < 0) { |
@@ -6254,7 +6254,7 @@ discard block |
||
| 6254 | 6254 | // Remainder to pay Multicurrency |
| 6255 | 6255 | if (isModEnabled('multicurrency') && $object->multicurrency_code && ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1)) { |
| 6256 | 6256 | print '<tr>'; |
| 6257 | - print '<td colspan="'.($nbcols+1).'" class="right">'; |
|
| 6257 | + print '<td colspan="'.($nbcols + 1).'" class="right">'; |
|
| 6258 | 6258 | print '<span class="opacitymedium">'; |
| 6259 | 6259 | print $langs->trans('RemainderToPayMulticurrency'); |
| 6260 | 6260 | if ($resteapayeraffiche < 0) { |
@@ -6282,14 +6282,14 @@ discard block |
||
| 6282 | 6282 | $billedWithRetainedWarranty = $object->total_ttc - $retainedWarranty; |
| 6283 | 6283 | |
| 6284 | 6284 | print '<tr>'; |
| 6285 | - print '<td colspan="'.($nbcols+1).'" class="right">'.$langs->trans("ToPayOn", dol_print_date($object->date_lim_reglement, 'day')).' :</td>'; |
|
| 6285 | + print '<td colspan="'.($nbcols + 1).'" class="right">'.$langs->trans("ToPayOn", dol_print_date($object->date_lim_reglement, 'day')).' :</td>'; |
|
| 6286 | 6286 | //print '<td></td>'; |
| 6287 | 6287 | print '<td class="right">'.price($billedWithRetainedWarranty).'</td>'; |
| 6288 | 6288 | print '</tr>'; |
| 6289 | 6289 | |
| 6290 | 6290 | // retained warranty |
| 6291 | 6291 | print '<tr>'; |
| 6292 | - print '<td colspan="'.($nbcols+1).'" class="right">'; |
|
| 6292 | + print '<td colspan="'.($nbcols + 1).'" class="right">'; |
|
| 6293 | 6293 | print $langs->trans("RetainedWarranty").' ('.$object->retained_warranty.'%)'; |
| 6294 | 6294 | print !empty($object->retained_warranty_date_limit) ? ' '.$langs->trans("ToPayOn", dol_print_date($object->retained_warranty_date_limit, 'day')) : ''; |
| 6295 | 6295 | print '</td>'; |
@@ -6304,7 +6304,7 @@ discard block |
||
| 6304 | 6304 | |
| 6305 | 6305 | // Total already paid back |
| 6306 | 6306 | print '<tr>'; |
| 6307 | - print '<td colspan="'.($nbcols+1).'" class="right">'; |
|
| 6307 | + print '<td colspan="'.($nbcols + 1).'" class="right">'; |
|
| 6308 | 6308 | print '<span class="opacitymedium">'.$langs->trans('AlreadyPaidBack').'</span>'; |
| 6309 | 6309 | print '</td>'; |
| 6310 | 6310 | //print '<td></td>'; |
@@ -6313,13 +6313,13 @@ discard block |
||
| 6313 | 6313 | |
| 6314 | 6314 | // Billed |
| 6315 | 6315 | print '<tr>'; |
| 6316 | - print '<td colspan="'.($nbcols+1).'" class="right"><span class="opacitymedium">'.$langs->trans("Billed").'</span></td>'; |
|
| 6316 | + print '<td colspan="'.($nbcols + 1).'" class="right"><span class="opacitymedium">'.$langs->trans("Billed").'</span></td>'; |
|
| 6317 | 6317 | //print '<td></td>'; |
| 6318 | 6318 | print '<td class="right">'.price($sign * $object->total_ttc).'</td>'; |
| 6319 | 6319 | print '</tr>'; |
| 6320 | 6320 | |
| 6321 | 6321 | // Remainder to pay back |
| 6322 | - print '<tr><td colspan="'.($nbcols+1).'" class="right">'; |
|
| 6322 | + print '<tr><td colspan="'.($nbcols + 1).'" class="right">'; |
|
| 6323 | 6323 | print '<span class="opacitymedium">'.$langs->trans('RemainderToPayBack'); |
| 6324 | 6324 | if ($resteapayeraffiche > 0) { |
| 6325 | 6325 | print ' ('.$langs->trans('NegativeIfExcessRefunded').')'; |
@@ -6335,7 +6335,7 @@ discard block |
||
| 6335 | 6335 | // Remainder to pay back Multicurrency |
| 6336 | 6336 | if (isModEnabled('multicurrency') && (($object->multicurrency_code && $object->multicurrency_code != $conf->currency) || $object->multicurrency_tx != 1)) { |
| 6337 | 6337 | print '<tr>'; |
| 6338 | - print '<td colspan="'.($nbcols+1).'" class="right">'; |
|
| 6338 | + print '<td colspan="'.($nbcols + 1).'" class="right">'; |
|
| 6339 | 6339 | print '<span class="opacitymedium">'.$langs->trans('RemainderToPayBackMulticurrency'); |
| 6340 | 6340 | if ($resteapayeraffiche > 0) { |
| 6341 | 6341 | print ' ('.$langs->trans('NegativeIfExcessRefunded').')'; |
@@ -6443,7 +6443,7 @@ discard block |
||
| 6443 | 6443 | if (isModEnabled('subtotals')) { |
| 6444 | 6444 | include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_ajaxrow.tpl.php'; |
| 6445 | 6445 | } else { |
| 6446 | - include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; |
|
| 6446 | + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; |
|
| 6447 | 6447 | } |
| 6448 | 6448 | } |
| 6449 | 6449 | |
@@ -6506,10 +6506,10 @@ discard block |
||
| 6506 | 6506 | if (!$objectidnext && $object->is_last_in_cycle()) { |
| 6507 | 6507 | if ($usercanunvalidate) { |
| 6508 | 6508 | unset($params['attr']['title']); |
| 6509 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=modif&token=' . newToken(), '', true, $params); |
|
| 6509 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=modif&token='.newToken(), '', true, $params); |
|
| 6510 | 6510 | } else { |
| 6511 | 6511 | $params['attr']['title'] = $langs->trans('NotEnoughPermissions'); |
| 6512 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=modif&token=' . newToken(), '', false, $params); |
|
| 6512 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=modif&token='.newToken(), '', false, $params); |
|
| 6513 | 6513 | } |
| 6514 | 6514 | } elseif (!$object->is_last_in_cycle()) { |
| 6515 | 6515 | $params['attr']['title'] = $langs->trans('NotLastInCycle'); |
@@ -6550,7 +6550,7 @@ discard block |
||
| 6550 | 6550 | $langs->load("contracts"); |
| 6551 | 6551 | |
| 6552 | 6552 | if ($usercancreatecontract) { |
| 6553 | - print '<a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a>'; |
|
| 6553 | + print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans('AddContract').'</a>'; |
|
| 6554 | 6554 | } |
| 6555 | 6555 | } |
| 6556 | 6556 | } |
@@ -6572,7 +6572,7 @@ discard block |
||
| 6572 | 6572 | |
| 6573 | 6573 | $url_button[] = array( |
| 6574 | 6574 | 'lang' => 'subtotals', |
| 6575 | - 'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element))), |
|
| 6575 | + 'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element))), |
|
| 6576 | 6576 | 'perm' => (bool) $usercancreate, |
| 6577 | 6577 | 'label' => $langs->trans('AddSubtotalLine'), |
| 6578 | 6578 | 'url' => '/compta/facture/card.php?facid='.$object->id.'&action=add_subtotal_line&token='.newToken() |
@@ -6807,7 +6807,7 @@ discard block |
||
| 6807 | 6807 | if ($usercandelete || ($usercancreate && $isErasable == 1)) { // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions) |
| 6808 | 6808 | $enableDelete = false; |
| 6809 | 6809 | $deleteHref = '#'; |
| 6810 | - if ($isErasable > 0 && ! $objectidnext) { |
|
| 6810 | + if ($isErasable > 0 && !$objectidnext) { |
|
| 6811 | 6811 | $deleteHref = $_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=delete&token='.newToken(); |
| 6812 | 6812 | $enableDelete = true; |
| 6813 | 6813 | } |