@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | $this->mode_reglement_id = 0; |
505 | 505 | } |
506 | 506 | $this->status = self::STATUS_DRAFT; |
507 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
507 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
508 | 508 | |
509 | 509 | if (!empty($this->multicurrency_code)) { |
510 | 510 | // Multicurrency (test on $this->multicurrency_tx because we should take the default rate of multicurrency_code only if not using original rate) |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | if (!empty($_facrec->frequency)) { // Invoice are created on same thirdparty than template when there is a recurrence, but not necessarily when there is no recurrence. |
579 | 579 | $this->socid = $_facrec->socid; |
580 | 580 | } |
581 | - $this->entity = $_facrec->entity; // Invoice created in same entity than template |
|
581 | + $this->entity = $_facrec->entity; // Invoice created in same entity than template |
|
582 | 582 | |
583 | 583 | // Fields coming from GUI. |
584 | 584 | // @TODO Value of template should be used as default value on the form on the GUI, and we should here always use the value from GUI |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | $this->mode_reglement_id = 0; |
618 | 618 | } |
619 | 619 | $this->status = self::STATUS_DRAFT; |
620 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
620 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
621 | 621 | |
622 | 622 | $this->linked_objects = $_facrec->linkedObjectsIds; |
623 | 623 | // We do not add link to template invoice or next invoice will be linked to all generated invoices |
@@ -863,7 +863,7 @@ discard block |
||
863 | 863 | |
864 | 864 | // Complete vat rate with code |
865 | 865 | $vatrate = $newinvoiceline->tva_tx; |
866 | - if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', (string) $vatrate)) { |
|
866 | + if ($newinvoiceline->vat_src_code && !preg_match('/\(.*\)/', (string) $vatrate)) { |
|
867 | 867 | $vatrate .= ' ('.$newinvoiceline->vat_src_code.')'; |
868 | 868 | } |
869 | 869 | |
@@ -1083,7 +1083,7 @@ discard block |
||
1083 | 1083 | ($_facrec->lines[$i]->date_end_fill == 1 && $previousdaynextdatewhen) ? $previousdaynextdatewhen : '', |
1084 | 1084 | 0, |
1085 | 1085 | $tva_npr, |
1086 | - 0, // fk_remise_except |
|
1086 | + 0, // fk_remise_except |
|
1087 | 1087 | 'HT', |
1088 | 1088 | 0, |
1089 | 1089 | $_facrec->lines[$i]->product_type, |
@@ -1096,8 +1096,8 @@ discard block |
||
1096 | 1096 | $buyprice, |
1097 | 1097 | $_facrec->lines[$i]->label, |
1098 | 1098 | empty($_facrec->lines[$i]->array_options) ? null : $_facrec->lines[$i]->array_options, |
1099 | - 100, // situation percent is undefined on recurring invoice lines |
|
1100 | - 0, // fk_prev_id |
|
1099 | + 100, // situation percent is undefined on recurring invoice lines |
|
1100 | + 0, // fk_prev_id |
|
1101 | 1101 | $_facrec->lines[$i]->fk_unit, |
1102 | 1102 | $_facrec->lines[$i]->multicurrency_subprice, |
1103 | 1103 | $_facrec->lines[$i]->ref_ext, |
@@ -1189,7 +1189,7 @@ discard block |
||
1189 | 1189 | |
1190 | 1190 | $facture->fk_facture_source = $this->fk_facture_source; |
1191 | 1191 | $facture->type = $this->type; |
1192 | - $facture->subtype = $this->subtype; |
|
1192 | + $facture->subtype = $this->subtype; |
|
1193 | 1193 | $facture->socid = $this->socid; |
1194 | 1194 | $facture->date = $this->date; |
1195 | 1195 | $facture->date_pointoftax = $this->date_pointoftax; |
@@ -1206,7 +1206,7 @@ discard block |
||
1206 | 1206 | |
1207 | 1207 | $facture->origin = $this->origin; |
1208 | 1208 | $facture->origin_id = $this->origin_id; |
1209 | - $facture->fk_account = $this->fk_account; |
|
1209 | + $facture->fk_account = $this->fk_account; |
|
1210 | 1210 | |
1211 | 1211 | $facture->lines = $this->lines; // Array of lines of invoice |
1212 | 1212 | $facture->situation_counter = $this->situation_counter; |
@@ -1473,8 +1473,8 @@ discard block |
||
1473 | 1473 | $this->fk_account = $object->fk_account; |
1474 | 1474 | $this->cond_reglement_id = $object->cond_reglement_id; |
1475 | 1475 | $this->mode_reglement_id = $object->mode_reglement_id; |
1476 | - $this->fk_incoterms = $object->fk_incoterms; |
|
1477 | - $this->location_incoterms = $object->location_incoterms; |
|
1476 | + $this->fk_incoterms = $object->fk_incoterms; |
|
1477 | + $this->location_incoterms = $object->location_incoterms; |
|
1478 | 1478 | $this->availability_id = $object->availability_id; |
1479 | 1479 | $this->demand_reason_id = $object->demand_reason_id; |
1480 | 1480 | $this->delivery_date = $object->delivery_date; |
@@ -1682,7 +1682,7 @@ discard block |
||
1682 | 1682 | { |
1683 | 1683 | global $conf, $langs, $hookmanager, $action; |
1684 | 1684 | |
1685 | - if (! in_array($origin->element, array('propal', 'commande'))) { |
|
1685 | + if (!in_array($origin->element, array('propal', 'commande'))) { |
|
1686 | 1686 | $origin->error = 'ErrorCanOnlyAutomaticallyGenerateADepositFromProposalOrOrder'; |
1687 | 1687 | return null; |
1688 | 1688 | } |
@@ -1692,7 +1692,7 @@ discard block |
||
1692 | 1692 | return null; |
1693 | 1693 | } |
1694 | 1694 | |
1695 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
1695 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
1696 | 1696 | |
1697 | 1697 | if ($date > (dol_get_last_hour(dol_now('tzuserrel')) + getDolGlobalInt('INVOICE_MAX_FUTURE_DELAY'))) { |
1698 | 1698 | $origin->error = 'ErrorDateIsInFuture'; |
@@ -1736,7 +1736,7 @@ discard block |
||
1736 | 1736 | $deposit->pos_source = $origin->pos_source; |
1737 | 1737 | $deposit->model_pdf = 'crabe'; |
1738 | 1738 | |
1739 | - $modelByTypeConfName = 'FACTURE_ADDON_PDF_' . $deposit->type; |
|
1739 | + $modelByTypeConfName = 'FACTURE_ADDON_PDF_'.$deposit->type; |
|
1740 | 1740 | |
1741 | 1741 | if (getDolGlobalString($modelByTypeConfName)) { |
1742 | 1742 | $deposit->model_pdf = getDolGlobalString($modelByTypeConfName); |
@@ -1796,10 +1796,10 @@ discard block |
||
1796 | 1796 | $descriptions[$key] = ''; |
1797 | 1797 | } |
1798 | 1798 | $TTotalByTva[$key] += $line->total_ttc; |
1799 | - $descriptions[$key] .= '<li>' . (!empty($line->product_ref) ? $line->product_ref . ' - ' : ''); |
|
1800 | - $descriptions[$key] .= (!empty($line->product_label) ? $line->product_label . ' - ' : ''); |
|
1801 | - $descriptions[$key] .= $langs->trans('Qty') . ' : ' . $line->qty; |
|
1802 | - $descriptions[$key] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($line->total_ht) . '</li>'; |
|
1799 | + $descriptions[$key] .= '<li>'.(!empty($line->product_ref) ? $line->product_ref.' - ' : ''); |
|
1800 | + $descriptions[$key] .= (!empty($line->product_label) ? $line->product_label.' - ' : ''); |
|
1801 | + $descriptions[$key] .= $langs->trans('Qty').' : '.$line->qty; |
|
1802 | + $descriptions[$key] .= ' - '.$langs->trans('TotalHT').' : '.price($line->total_ht).'</li>'; |
|
1803 | 1803 | } |
1804 | 1804 | |
1805 | 1805 | foreach ($TTotalByTva as $tva => &$total) { |
@@ -1823,10 +1823,10 @@ discard block |
||
1823 | 1823 | $totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ? |
1824 | 1824 | $tva_tx = $lines[$i]->tva_tx; |
1825 | 1825 | $amountdeposit[$tva_tx] += ((float) $lines[$i]->total_ht * (float) $origin->deposit_percent) / 100; |
1826 | - $descriptions[$tva_tx] .= '<li>' . (!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref . ' - ' : ''); |
|
1827 | - $descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label . ' - ' : ''); |
|
1828 | - $descriptions[$tva_tx] .= $langs->trans('Qty') . ' : ' . $lines[$i]->qty; |
|
1829 | - $descriptions[$tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($lines[$i]->total_ht) . '</li>'; |
|
1826 | + $descriptions[$tva_tx] .= '<li>'.(!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref.' - ' : ''); |
|
1827 | + $descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label.' - ' : ''); |
|
1828 | + $descriptions[$tva_tx] .= $langs->trans('Qty').' : '.$lines[$i]->qty; |
|
1829 | + $descriptions[$tva_tx] .= ' - '.$langs->trans('TotalHT').' : '.price($lines[$i]->total_ht).'</li>'; |
|
1830 | 1830 | } |
1831 | 1831 | |
1832 | 1832 | if ($totalamount == 0) { |
@@ -1841,11 +1841,11 @@ discard block |
||
1841 | 1841 | continue; |
1842 | 1842 | } |
1843 | 1843 | |
1844 | - $descline = '(DEPOSIT) ('. $origin->deposit_percent .'%) - '.$origin->ref; |
|
1844 | + $descline = '(DEPOSIT) ('.$origin->deposit_percent.'%) - '.$origin->ref; |
|
1845 | 1845 | |
1846 | 1846 | // Hidden conf |
1847 | 1847 | if (getDolGlobalString('INVOICE_DEPOSIT_VARIABLE_MODE_DETAIL_LINES_IN_DESCRIPTION') && !empty($descriptions[$tva])) { |
1848 | - $descline .= '<ul>' . $descriptions[$tva] . '</ul>'; |
|
1848 | + $descline .= '<ul>'.$descriptions[$tva].'</ul>'; |
|
1849 | 1849 | } |
1850 | 1850 | |
1851 | 1851 | $addlineResult = $deposit->addline( |
@@ -2225,9 +2225,9 @@ discard block |
||
2225 | 2225 | $this->id = $obj->rowid; |
2226 | 2226 | $this->entity = $obj->entity; |
2227 | 2227 | |
2228 | - $this->ref = $obj->ref; |
|
2229 | - $this->ref_client = $obj->ref_client; |
|
2230 | - $this->ref_customer = $obj->ref_client; |
|
2228 | + $this->ref = $obj->ref; |
|
2229 | + $this->ref_client = $obj->ref_client; |
|
2230 | + $this->ref_customer = $obj->ref_client; |
|
2231 | 2231 | $this->ref_ext = $obj->ref_ext; |
2232 | 2232 | $this->type = $obj->type; |
2233 | 2233 | $this->subtype = $obj->subtype; |
@@ -2253,7 +2253,7 @@ discard block |
||
2253 | 2253 | $this->fk_project = $obj->fk_project; |
2254 | 2254 | $this->project = null; // Clear if another value was already set by fetch_projet |
2255 | 2255 | |
2256 | - $this->statut = $obj->status; // deprecated |
|
2256 | + $this->statut = $obj->status; // deprecated |
|
2257 | 2257 | $this->status = $obj->status; |
2258 | 2258 | |
2259 | 2259 | $this->date_lim_reglement = $this->db->jdate($obj->dlr); |
@@ -2269,7 +2269,7 @@ discard block |
||
2269 | 2269 | $this->fk_fac_rec_source = $obj->fk_fac_rec_source; |
2270 | 2270 | $this->note = $obj->note_private; // deprecated |
2271 | 2271 | $this->note_private = $obj->note_private; |
2272 | - $this->note_public = $obj->note_public; |
|
2272 | + $this->note_public = $obj->note_public; |
|
2273 | 2273 | $this->user_creation_id = $obj->fk_user_author; |
2274 | 2274 | $this->user_validation_id = $obj->fk_user_valid; |
2275 | 2275 | $this->user_modification_id = $obj->fk_user_modif; |
@@ -2383,7 +2383,7 @@ discard block |
||
2383 | 2383 | $line->ref = $objp->product_ref; // Ref product |
2384 | 2384 | $line->product_ref = $objp->product_ref; // Ref product |
2385 | 2385 | $line->libelle = $objp->product_label; // deprecated |
2386 | - $line->product_label = $objp->product_label; // Label product |
|
2386 | + $line->product_label = $objp->product_label; // Label product |
|
2387 | 2387 | $line->product_barcode = $objp->product_barcode; // Barcode number product |
2388 | 2388 | $line->product_desc = $objp->product_desc; // Description product |
2389 | 2389 | $line->fk_product_type = $objp->fk_product_type; // Type of product |
@@ -3257,10 +3257,10 @@ discard block |
||
3257 | 3257 | if ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('facture', 'creer')) |
3258 | 3258 | || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('facture', 'invoice_advance', 'validate'))) { |
3259 | 3259 | $this->error = 'Permission denied'; |
3260 | - dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS=' . getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR); |
|
3260 | + dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS='.getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR); |
|
3261 | 3261 | return -1; |
3262 | 3262 | } |
3263 | - if ((preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) && // empty should not happened, but when it occurs, the test save life |
|
3263 | + if ((preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) && // empty should not happened, but when it occurs, the test save life |
|
3264 | 3264 | getDolGlobalString('FAC_FORCE_DATE_VALIDATION') // If option enabled, we force invoice date |
3265 | 3265 | ) { |
3266 | 3266 | $this->date = dol_now(); |
@@ -3438,7 +3438,7 @@ discard block |
||
3438 | 3438 | for ($i = 0; $i < $cpt; $i++) { |
3439 | 3439 | if ($this->lines[$i]->fk_product > 0) { |
3440 | 3440 | $mouvP = new MouvementStock($this->db); |
3441 | - $mouvP->origin = &$this; // deprecated |
|
3441 | + $mouvP->origin = &$this; // deprecated |
|
3442 | 3442 | $mouvP->setOrigin($this->element, $this->id); |
3443 | 3443 | |
3444 | 3444 | // We decrease stock for product |
@@ -3632,7 +3632,7 @@ discard block |
||
3632 | 3632 | // Set new ref and define current status |
3633 | 3633 | if (!$error) { |
3634 | 3634 | $this->ref = $num; |
3635 | - $this->statut = self::STATUS_VALIDATED; // deprecated |
|
3635 | + $this->statut = self::STATUS_VALIDATED; // deprecated |
|
3636 | 3636 | $this->status = self::STATUS_VALIDATED; |
3637 | 3637 | $this->date_validation = $now; |
3638 | 3638 | $i = 0; |
@@ -3787,7 +3787,7 @@ discard block |
||
3787 | 3787 | |
3788 | 3788 | if ($error == 0) { |
3789 | 3789 | $old_statut = $this->status; |
3790 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
3790 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
3791 | 3791 | $this->status = self::STATUS_DRAFT; |
3792 | 3792 | |
3793 | 3793 | // Call trigger |
@@ -4692,7 +4692,7 @@ discard block |
||
4692 | 4692 | } |
4693 | 4693 | |
4694 | 4694 | if (!empty($addon)) { |
4695 | - dol_syslog("Call getNextNumRef with ".$addonConstName." = " . getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG); |
|
4695 | + dol_syslog("Call getNextNumRef with ".$addonConstName." = ".getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG); |
|
4696 | 4696 | |
4697 | 4697 | $mybool = false; |
4698 | 4698 | |
@@ -5159,7 +5159,7 @@ discard block |
||
5159 | 5159 | |
5160 | 5160 | if (empty($option) || $option != 'nolines') { |
5161 | 5161 | // Lines |
5162 | - $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
5162 | + $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
5163 | 5163 | $xnbp = 0; |
5164 | 5164 | while ($xnbp < $nbp) { |
5165 | 5165 | $line = new FactureLigne($this->db); |
@@ -5772,14 +5772,14 @@ discard block |
||
5772 | 5772 | if (!empty($paymentmode) && $paymentmode != 'all') { |
5773 | 5773 | $sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp"; |
5774 | 5774 | } |
5775 | - $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
5776 | - $sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status |
|
5775 | + $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
5776 | + $sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status |
|
5777 | 5777 | if ($datetouse == 'invoicedate') { |
5778 | 5778 | $sql .= " AND f.datef = '".$this->db->idate($tmpidate, 'gmt')."'"; |
5779 | 5779 | } else { |
5780 | 5780 | $sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'"; |
5781 | 5781 | } |
5782 | - $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing) |
|
5782 | + $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing) |
|
5783 | 5783 | if (!empty($paymentmode) && $paymentmode != 'all') { |
5784 | 5784 | $sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'"; |
5785 | 5785 | } |
@@ -5997,7 +5997,7 @@ discard block |
||
5997 | 5997 | $actioncomm->create($user); |
5998 | 5998 | } |
5999 | 5999 | |
6000 | - $this->db->commit(); // We always commit |
|
6000 | + $this->db->commit(); // We always commit |
|
6001 | 6001 | } |
6002 | 6002 | |
6003 | 6003 | if ($errormesg) { |
@@ -6039,7 +6039,7 @@ discard block |
||
6039 | 6039 | // get date of last validated invoices of same type |
6040 | 6040 | $sql = "SELECT datef"; |
6041 | 6041 | $sql .= " FROM ".MAIN_DB_PREFIX."facture"; |
6042 | - $sql .= " WHERE type = " . (int) $this->type ; |
|
6042 | + $sql .= " WHERE type = ".(int) $this->type; |
|
6043 | 6043 | $sql .= " AND date_valid IS NOT NULL"; |
6044 | 6044 | $sql .= " AND entity IN (".getEntity('invoice').")"; |
6045 | 6045 | $sql .= " ORDER BY datef DESC LIMIT 1"; |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | } |
667 | 667 | $txlocaltax1 = price2num($txlocaltax1); |
668 | 668 | $txlocaltax2 = price2num($txlocaltax2); |
669 | - $pa_ht = price2num($pa_ht); // do not convert to float here, it breaks the functioning of $pa_ht_isemptystring |
|
669 | + $pa_ht = price2num($pa_ht); // do not convert to float here, it breaks the functioning of $pa_ht_isemptystring |
|
670 | 670 | if ($price_base_type == 'HT') { |
671 | 671 | $pu = $pu_ht; |
672 | 672 | } else { |
@@ -894,7 +894,7 @@ discard block |
||
894 | 894 | } |
895 | 895 | $txlocaltax1 = price2num($txlocaltax1); |
896 | 896 | $txlocaltax2 = price2num($txlocaltax2); |
897 | - $pa_ht = price2num($pa_ht); // do not convert to float here, it breaks the functioning of $pa_ht_isemptystring |
|
897 | + $pa_ht = price2num($pa_ht); // do not convert to float here, it breaks the functioning of $pa_ht_isemptystring |
|
898 | 898 | if (empty($qty) && empty($special_code)) { |
899 | 899 | $special_code = 3; // Set option tag |
900 | 900 | } |
@@ -1479,7 +1479,7 @@ discard block |
||
1479 | 1479 | if ($objsoc->id > 0 && !empty($object->lines)) { |
1480 | 1480 | if ($update_prices === true && getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { |
1481 | 1481 | // If price per customer |
1482 | - require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; |
|
1482 | + require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php'; |
|
1483 | 1483 | } |
1484 | 1484 | |
1485 | 1485 | foreach ($object->lines as $line) { |
@@ -1673,7 +1673,7 @@ discard block |
||
1673 | 1673 | $this->ref_customer = $obj->ref_client; |
1674 | 1674 | $this->ref_ext = $obj->ref_ext; |
1675 | 1675 | |
1676 | - $this->total = $obj->total_ttc; // TODO deprecated |
|
1676 | + $this->total = $obj->total_ttc; // TODO deprecated |
|
1677 | 1677 | $this->total_ttc = $obj->total_ttc; |
1678 | 1678 | $this->total_ht = $obj->total_ht; |
1679 | 1679 | $this->total_tva = $obj->total_tva; |
@@ -2588,7 +2588,7 @@ discard block |
||
2588 | 2588 | */ |
2589 | 2589 | public function closeProposal($user, $status, $note_private = '', $notrigger = 0, $note_public = '') |
2590 | 2590 | { |
2591 | - global $langs,$conf; |
|
2591 | + global $langs, $conf; |
|
2592 | 2592 | |
2593 | 2593 | $error = 0; |
2594 | 2594 | $now = dol_now(); |
@@ -2623,10 +2623,10 @@ discard block |
||
2623 | 2623 | if ($resql) { |
2624 | 2624 | // Status self::STATUS_REFUSED by default |
2625 | 2625 | $modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_CLOSED', $this->model_pdf); |
2626 | - $trigger_name = 'PROPAL_CLOSE_REFUSED'; // used later in call_trigger() |
|
2626 | + $trigger_name = 'PROPAL_CLOSE_REFUSED'; // used later in call_trigger() |
|
2627 | 2627 | |
2628 | 2628 | if ($status == self::STATUS_SIGNED) { // Status self::STATUS_SIGNED |
2629 | - $trigger_name = 'PROPAL_CLOSE_SIGNED'; // used later in call_trigger() |
|
2629 | + $trigger_name = 'PROPAL_CLOSE_SIGNED'; // used later in call_trigger() |
|
2630 | 2630 | $modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_TOBILL') ? $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL : $this->model_pdf; |
2631 | 2631 | |
2632 | 2632 | // The connected company is classified as a client |
@@ -2793,10 +2793,10 @@ discard block |
||
2793 | 2793 | |
2794 | 2794 | $this->db->begin(); |
2795 | 2795 | |
2796 | - $sql = "UPDATE ". MAIN_DB_PREFIX . "propal"; |
|
2797 | - $sql .= " SET fk_statut = " . self::STATUS_CANCELED . ","; |
|
2798 | - $sql .= " fk_user_modif = " . ((int) $user->id); |
|
2799 | - $sql .= " WHERE rowid = " . ((int) $this->id); |
|
2796 | + $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; |
|
2797 | + $sql .= " SET fk_statut = ".self::STATUS_CANCELED.","; |
|
2798 | + $sql .= " fk_user_modif = ".((int) $user->id); |
|
2799 | + $sql .= " WHERE rowid = ".((int) $this->id); |
|
2800 | 2800 | |
2801 | 2801 | dol_syslog(get_class($this)."::cancel", LOG_DEBUG); |
2802 | 2802 | if ($this->db->query($sql)) { |
@@ -3159,7 +3159,7 @@ discard block |
||
3159 | 3159 | } |
3160 | 3160 | } |
3161 | 3161 | if (file_exists($dir)) { |
3162 | - $res = @dol_delete_dir_recursive($dir); // delete files physically + into ecm tables |
|
3162 | + $res = @dol_delete_dir_recursive($dir); // delete files physically + into ecm tables |
|
3163 | 3163 | if (!$res) { |
3164 | 3164 | $this->error = 'ErrorFailToDeleteDir'; |
3165 | 3165 | $this->errors[] = $this->error; |
@@ -3563,7 +3563,7 @@ discard block |
||
3563 | 3563 | $this->multicurrency_code = $conf->currency; |
3564 | 3564 | |
3565 | 3565 | // Lines |
3566 | - $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
3566 | + $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
3567 | 3567 | $xnbp = 0; |
3568 | 3568 | while ($xnbp < $nbp) { |
3569 | 3569 | $line = new PropaleLigne($this->db); |
@@ -3893,7 +3893,7 @@ discard block |
||
3893 | 3893 | } |
3894 | 3894 | |
3895 | 3895 | global $action; |
3896 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
3896 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
3897 | 3897 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
3898 | 3898 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
3899 | 3899 | if ($reshook > 0) { |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | $id = GETPOSTINT('id'); |
112 | 112 | $rowid = GETPOST('rowid', 'alpha'); |
113 | -$entity = GETPOST('entity', 'alpha'); // Do not use GETPOSTINT here. Should be '', 0 or >0. |
|
113 | +$entity = GETPOST('entity', 'alpha'); // Do not use GETPOSTINT here. Should be '', 0 or >0. |
|
114 | 114 | $code = GETPOST('code', 'alpha'); |
115 | 115 | $from = GETPOST('from', 'alpha'); |
116 | 116 | |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | $tabcond[DICT_STCOMM] = isModEnabled("societe"); |
580 | 580 | $tabcond[DICT_HOLIDAY_TYPES] = isModEnabled('holiday'); |
581 | 581 | $tabcond[DICT_LEAD_STATUS] = isModEnabled('project'); |
582 | -$tabcond[DICT_FORMAT_CARDS] = (isModEnabled('label') || isModEnabled('barcode') || isModEnabled('member')); // stickers format dictionary |
|
582 | +$tabcond[DICT_FORMAT_CARDS] = (isModEnabled('label') || isModEnabled('barcode') || isModEnabled('member')); // stickers format dictionary |
|
583 | 583 | $tabcond[DICT_INVOICE_SUBTYPE] = ((isModEnabled('invoice') || isModEnabled('supplier_invoice')) && $mysoc->country_code == 'GR'); |
584 | 584 | $tabcond[DICT_HRM_PUBLIC_HOLIDAY] = (isModEnabled('holiday') || isModEnabled('hrm')); |
585 | 585 | $tabcond[DICT_HRM_DEPARTMENT] = isModEnabled('hrm'); |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | 'project_task' => img_picto('', 'projecttask', 'class="pictofixedwidth"').$langs->trans('Task'), |
717 | 717 | 'propal' => img_picto('', 'propal', 'class="pictofixedwidth"').$langs->trans('Proposal'), |
718 | 718 | 'commande' => img_picto('', 'order', 'class="pictofixedwidth"').$langs->trans('Order'), |
719 | - 'shipping' => img_picto('', 'dolly', 'class="pictofixedwidth"') . $langs->trans('Shipment'), |
|
719 | + 'shipping' => img_picto('', 'dolly', 'class="pictofixedwidth"').$langs->trans('Shipment'), |
|
720 | 720 | 'facture' => img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans('Bill'), |
721 | 721 | 'fichinter' => img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterventionCard'), |
722 | 722 | 'contrat' => img_picto('', 'contract', 'class="pictofixedwidth"').$langs->trans('Contract'), |
@@ -993,7 +993,7 @@ discard block |
||
993 | 993 | if ($value == 'price' || preg_match('/^amount/i', $value)) { |
994 | 994 | $_POST[$keycode] = price2num(GETPOST($keycode), 'MU'); |
995 | 995 | } elseif ($value == 'taux' || $value == 'localtax1') { |
996 | - $_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z |
|
996 | + $_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z |
|
997 | 997 | } elseif ($value == 'entity') { |
998 | 998 | $_POST[$keycode] = getEntity($tablename); |
999 | 999 | } |
@@ -1062,7 +1062,7 @@ discard block |
||
1062 | 1062 | if ($field == 'price' || preg_match('/^amount/i', $field)) { |
1063 | 1063 | $_POST[$keycode] = price2num(GETPOST($keycode), 'MU'); |
1064 | 1064 | } elseif ($field == 'taux' || $field == 'localtax1') { |
1065 | - $_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z |
|
1065 | + $_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z |
|
1066 | 1066 | } elseif ($field == 'entity') { |
1067 | 1067 | $_POST[$keycode] = getEntity($tablename); |
1068 | 1068 | } |
@@ -2572,7 +2572,7 @@ discard block |
||
2572 | 2572 | } |
2573 | 2573 | // Show value for field |
2574 | 2574 | if ($showfield) { |
2575 | - print '<!-- '. $value .' --><td class="'.$class.'"'.($titletoshow ? ' title="'.dolPrintHTMLForAttribute($titletoshow).'"' : '').'>'.$valuetoshow.'</td>'; |
|
2575 | + print '<!-- '.$value.' --><td class="'.$class.'"'.($titletoshow ? ' title="'.dolPrintHTMLForAttribute($titletoshow).'"' : '').'>'.$valuetoshow.'</td>'; |
|
2576 | 2576 | } |
2577 | 2577 | } |
2578 | 2578 | |
@@ -2760,7 +2760,7 @@ discard block |
||
2760 | 2760 | // Special case for c_actioncomm (field that should not be modified) |
2761 | 2761 | $hidden = (!empty($obj->{$value}) ? $obj->{$value} : ''); |
2762 | 2762 | print '<td>'; |
2763 | - print '<input type="hidden" name="'. $value .'" value="'.$hidden.'">'; |
|
2763 | + print '<input type="hidden" name="'.$value.'" value="'.$hidden.'">'; |
|
2764 | 2764 | print $langs->trans($hidden); |
2765 | 2765 | print '</td>'; |
2766 | 2766 | } elseif ($value == 'country') { |
@@ -2781,7 +2781,7 @@ discard block |
||
2781 | 2781 | if (!in_array('country', $fieldlist)) { // If there is already a field country, we don't show country_id (avoid duplicate) |
2782 | 2782 | $country_id = (!empty($obj->{$value}) ? $obj->{$value} : 0); |
2783 | 2783 | print '<td class="tdoverflowmax100">'; |
2784 | - print '<input type="hidden" name="'. $value .'" value="'.$country_id.'">'; |
|
2784 | + print '<input type="hidden" name="'.$value.'" value="'.$country_id.'">'; |
|
2785 | 2785 | print '</td>'; |
2786 | 2786 | } |
2787 | 2787 | } elseif ($value == 'region') { |
@@ -2791,7 +2791,7 @@ discard block |
||
2791 | 2791 | } elseif ($value == 'region_id') { |
2792 | 2792 | $region_id = (!empty($obj->{$value}) ? $obj->{$value} : 0); |
2793 | 2793 | print '<td>'; |
2794 | - print '<input type="hidden" name="'. $value .'" value="'.$region_id.'">'; |
|
2794 | + print '<input type="hidden" name="'.$value.'" value="'.$region_id.'">'; |
|
2795 | 2795 | print '</td>'; |
2796 | 2796 | } elseif ($value == 'department_buyer') { |
2797 | 2797 | if ($context == 'edit') { |
@@ -2865,7 +2865,7 @@ discard block |
||
2865 | 2865 | $class = "center"; // Fields aligned on right |
2866 | 2866 | } |
2867 | 2867 | print '<td class="'.$class.'">'; |
2868 | - print '<input type="text" class="flat" value="'.(isset($obj->{$value}) ? $obj->{$value} : '').'" size="3" name="'. $value .'">'; |
|
2868 | + print '<input type="text" class="flat" value="'.(isset($obj->{$value}) ? $obj->{$value} : '').'" size="3" name="'.$value.'">'; |
|
2869 | 2869 | print '</td>'; |
2870 | 2870 | } elseif (in_array($value, array('libelle_facture'))) { |
2871 | 2871 | print '<td>'; |
@@ -2875,7 +2875,7 @@ discard block |
||
2875 | 2875 | if ($tabname == 'c_payment_term') { |
2876 | 2876 | $langs->load("bills"); |
2877 | 2877 | if (isset($obj->code) && !empty($obj->code)) { |
2878 | - $transkey = "PaymentCondition" . strtoupper($obj->code); |
|
2878 | + $transkey = "PaymentCondition".strtoupper($obj->code); |
|
2879 | 2879 | if ($langs->trans($transkey) != $transkey) { |
2880 | 2880 | $transfound = 1; |
2881 | 2881 | print $form->textwithpicto($langs->trans($transkey), $langs->trans("GoIntoTranslationMenuToChangeThis")); |
@@ -2883,21 +2883,21 @@ discard block |
||
2883 | 2883 | } |
2884 | 2884 | } |
2885 | 2885 | if (!$transfound) { |
2886 | - print '<textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'. $value .'">'.(empty($obj->{$value}) ? '' : $obj->{$value}).'</textarea>'; |
|
2886 | + print '<textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'.$value.'">'.(empty($obj->{$value}) ? '' : $obj->{$value}).'</textarea>'; |
|
2887 | 2887 | } else { |
2888 | - print '<input type="hidden" name="'. $value .'" value="'.$transkey.'">'; |
|
2888 | + print '<input type="hidden" name="'.$value.'" value="'.$transkey.'">'; |
|
2889 | 2889 | } |
2890 | 2890 | print '</td>'; |
2891 | 2891 | } elseif ($value == 'price' || preg_match('/^amount/i', (string) $value)) { |
2892 | - print '<td><input type="text" class="flat minwidth75" value="'.price((!empty($obj->{$value}) ? $obj->{$value} : '')).'" name="'. $value .'"></td>'; |
|
2892 | + print '<td><input type="text" class="flat minwidth75" value="'.price((!empty($obj->{$value}) ? $obj->{$value} : '')).'" name="'.$value.'"></td>'; |
|
2893 | 2893 | } elseif ($value == 'code' && isset($obj->{$value})) { |
2894 | 2894 | print '<td>'; |
2895 | 2895 | if ($tabname == 'c_paiement' && in_array($obj->{$value}, array('LIQ', 'CB', 'CHQ', 'VIR'))) { |
2896 | 2896 | // Case of code that should not be modified |
2897 | - print '<input type="hidden" class="flat minwidth75 maxwidth100" value="'.(empty($obj->{$value}) ? '' : $obj->{$value}).'" name="'. $value .'">'; |
|
2897 | + print '<input type="hidden" class="flat minwidth75 maxwidth100" value="'.(empty($obj->{$value}) ? '' : $obj->{$value}).'" name="'.$value.'">'; |
|
2898 | 2898 | print $obj->{$value}; |
2899 | 2899 | } else { |
2900 | - print '<input type="text" class="flat minwidth75 maxwidth100" value="'.(empty($obj->{$value}) ? '' : $obj->{$value}).'" name="'. $value .'">'; |
|
2900 | + print '<input type="text" class="flat minwidth75 maxwidth100" value="'.(empty($obj->{$value}) ? '' : $obj->{$value}).'" name="'.$value.'">'; |
|
2901 | 2901 | } |
2902 | 2902 | print '</td>'; |
2903 | 2903 | } elseif ($value == 'unit') { |
@@ -2925,10 +2925,10 @@ discard block |
||
2925 | 2925 | if (isModEnabled('accounting')) { |
2926 | 2926 | $fieldname = $value; |
2927 | 2927 | $accountancy_account = (empty($obj->$fieldname) ? 0 : $obj->$fieldname); |
2928 | - print $formaccounting->select_account($accountancy_account, '.'. $value, 1, array(), 1, 1, 'maxwidth125 maxwidthonsmartphone'); |
|
2928 | + print $formaccounting->select_account($accountancy_account, '.'.$value, 1, array(), 1, 1, 'maxwidth125 maxwidthonsmartphone'); |
|
2929 | 2929 | } else { |
2930 | 2930 | $fieldname = $value; |
2931 | - print '<input type="text" class="flat minwidth100" value="'.(isset($obj->$fieldname) ? $obj->$fieldname : '').'" name="'. $value .'">'; |
|
2931 | + print '<input type="text" class="flat minwidth100" value="'.(isset($obj->$fieldname) ? $obj->$fieldname : '').'" name="'.$value.'">'; |
|
2932 | 2932 | } |
2933 | 2933 | print '</td>'; |
2934 | 2934 | } elseif ($value == 'fk_tva') { |
@@ -2949,7 +2949,7 @@ discard block |
||
2949 | 2949 | print '</td>'; |
2950 | 2950 | } elseif ($value == 'type_duration') { |
2951 | 2951 | print '<td>'; |
2952 | - print $form->selectTypeDuration('', (empty($obj->type_duration) ? '' : $obj->type_duration), array('i','h')); |
|
2952 | + print $form->selectTypeDuration('', (empty($obj->type_duration) ? '' : $obj->type_duration), array('i', 'h')); |
|
2953 | 2953 | print '</td>'; |
2954 | 2954 | } else { |
2955 | 2955 | $fieldValue = isset($obj->{$value}) ? $obj->{$value} : ''; |
@@ -125,9 +125,9 @@ discard block |
||
125 | 125 | |
126 | 126 | $now = dol_now(); |
127 | 127 | |
128 | -$title = $object->ref . ' - ' . $langs->trans("Notes"); |
|
128 | +$title = $object->ref.' - '.$langs->trans("Notes"); |
|
129 | 129 | if (!empty($withproject)) { |
130 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '') ; |
|
130 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
131 | 131 | } |
132 | 132 | $help_url = ''; |
133 | 133 | |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $cols = 2; |
237 | 237 | $savobject = $object; |
238 | 238 | $object = $projectstatic; |
239 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
239 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
240 | 240 | $object = $savobject; |
241 | 241 | |
242 | 242 | print '</table>'; |
@@ -34,14 +34,14 @@ discard block |
||
34 | 34 | |
35 | 35 | // Load Dolibarr environment |
36 | 36 | require '../../main.inc.php'; |
37 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
38 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php'; |
|
39 | -require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
40 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
41 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
42 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
|
43 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
44 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
38 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; |
|
39 | +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
40 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
41 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
42 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; |
|
43 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
44 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php'; |
|
45 | 45 | |
46 | 46 | /** |
47 | 47 | * @var Conf $conf |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
181 | 181 | } |
182 | 182 | |
183 | -include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
|
183 | +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
|
184 | 184 | |
185 | 185 | // Purge search criteria |
186 | 186 | 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 |
@@ -362,10 +362,10 @@ discard block |
||
362 | 362 | } |
363 | 363 | |
364 | 364 | if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) { |
365 | - $object->fetchTimeSpent(GETPOSTINT('lineid')); // load properties like $object->timespent_xxx |
|
365 | + $object->fetchTimeSpent(GETPOSTINT('lineid')); // load properties like $object->timespent_xxx |
|
366 | 366 | |
367 | 367 | if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
368 | - $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
|
368 | + $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
|
369 | 369 | |
370 | 370 | if ($result < 0) { |
371 | 371 | $langs->load("errors"); |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | if (count($tasksarray) > 0) { |
386 | 386 | $id = $tasksarray[0]->id; |
387 | 387 | } else { |
388 | - header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode)); |
|
388 | + header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); |
|
389 | 389 | exit; |
390 | 390 | } |
391 | 391 | } |
@@ -422,9 +422,9 @@ discard block |
||
422 | 422 | if (!($projectstatic->thirdparty->id > 0)) { |
423 | 423 | setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors'); |
424 | 424 | } else { |
425 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
426 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
427 | - include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
425 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
426 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
427 | + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
428 | 428 | |
429 | 429 | $tmpinvoice = new Facture($db); |
430 | 430 | $tmptimespent = new Task($db); |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | $arrayoftasks = array(); |
491 | 491 | foreach ($toselect as $key => $value) { |
492 | 492 | // Get userid, timepent |
493 | - $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
|
493 | + $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
|
494 | 494 | $arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
495 | 495 | $arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
496 | 496 | } |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | } |
564 | 564 | |
565 | 565 | // Add lines |
566 | - $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject); |
|
566 | + $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject); |
|
567 | 567 | if ($lineid < 0) { |
568 | 568 | $error++; |
569 | 569 | setEventMessages(null, $tmpinvoice->errors, 'errors'); |
@@ -596,16 +596,16 @@ discard block |
||
596 | 596 | |
597 | 597 | $arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration; |
598 | 598 | $arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm; |
599 | - $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref . ' - ' . $ftask->label . ' - ' . $username; |
|
599 | + $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username; |
|
600 | 600 | $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $object->timespent_note); |
601 | 601 | |
602 | 602 | if (!empty($withdetail)) { |
603 | 603 | if (!empty($object->timespent_withhour)) { |
604 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour)); |
|
604 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_datehour)); |
|
605 | 605 | } else { |
606 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_date)); |
|
606 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_date)); |
|
607 | 607 | } |
608 | - $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)); |
|
608 | + $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)); |
|
609 | 609 | } |
610 | 610 | $arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user; |
611 | 611 | $arrayoftasks[$object->timespent_id]['fk_product'] = $object->timespent_fk_product; |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | $arrayoftasks = array(); |
684 | 684 | foreach ($toselect as $key => $value) { |
685 | 685 | // Get userid, timepent |
686 | - $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object) |
|
686 | + $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object) |
|
687 | 687 | // $object->id is now the task id |
688 | 688 | $arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
689 | 689 | $arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
@@ -759,7 +759,7 @@ discard block |
||
759 | 759 | // Add lines |
760 | 760 | $date_start = ''; |
761 | 761 | $date_end = ''; |
762 | - $lineName = $ftask->ref . ' - ' . $ftask->label; |
|
762 | + $lineName = $ftask->ref.' - '.$ftask->label; |
|
763 | 763 | $lineid = $tmpinvoice->addline($lineName, $pu_ht_for_task, price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject, $date_start, $date_end, 0, 0, '', 'HT', 0, 1, -1, 0, '', 0, 0, null, $pa_ht); |
764 | 764 | if ($lineid < 0) { |
765 | 765 | $error++; |
@@ -769,8 +769,8 @@ discard block |
||
769 | 769 | |
770 | 770 | if (!$error) { |
771 | 771 | // Update lineid into line of timespent |
772 | - $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'element_time SET invoice_line_id = ' . ((int) $lineid) . ', invoice_id = ' . ((int) $tmpinvoice->id); |
|
773 | - $sql .= ' WHERE rowid IN (' . $db->sanitize(implode(',', $toselect)) . ')'; |
|
772 | + $sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id); |
|
773 | + $sql .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $toselect)).')'; |
|
774 | 774 | $result = $db->query($sql); |
775 | 775 | if (!$result) { |
776 | 776 | $error++; |
@@ -806,12 +806,12 @@ discard block |
||
806 | 806 | if (!($projectstatic->thirdparty->id > 0)) { |
807 | 807 | setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors'); |
808 | 808 | } else { |
809 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
810 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
811 | - include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
809 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
810 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
811 | + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
812 | 812 | |
813 | 813 | |
814 | - require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php'; |
|
814 | + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; |
|
815 | 815 | $tmpinter = new Fichinter($db); |
816 | 816 | $tmptimespent = new Task($db); |
817 | 817 | $fuser = new User($db); |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | $tmpinter->socid = $projectstatic->thirdparty->id; |
824 | 824 | $tmpinter->date = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); |
825 | 825 | $tmpinter->fk_project = $projectstatic->id; |
826 | - $tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : ''); |
|
826 | + $tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : ''); |
|
827 | 827 | |
828 | 828 | if ($interToUse) { |
829 | 829 | $tmpinter->fetch($interToUse); |
@@ -856,7 +856,7 @@ discard block |
||
856 | 856 | $qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); |
857 | 857 | |
858 | 858 | // Add lines |
859 | - $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), $value['date'], $value['timespent']); |
|
859 | + $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), $value['date'], $value['timespent']); |
|
860 | 860 | } |
861 | 861 | } |
862 | 862 | |
@@ -887,9 +887,9 @@ discard block |
||
887 | 887 | //$result = $projectstatic->fetch($object->fk_project); |
888 | 888 | $arrayofselected = is_array($toselect) ? $toselect : array(); |
889 | 889 | |
890 | -$title = $object->ref . ' - ' . $langs->trans("TimeSpent"); |
|
890 | +$title = $object->ref.' - '.$langs->trans("TimeSpent"); |
|
891 | 891 | if (!empty($withproject)) { |
892 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : ''); |
|
892 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
893 | 893 | } |
894 | 894 | $help_url = ''; |
895 | 895 | |
@@ -938,13 +938,13 @@ discard block |
||
938 | 938 | |
939 | 939 | $param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : ''); |
940 | 940 | if ($search_user) { |
941 | - $param .= '&search_user=' . ((int) $search_user); |
|
941 | + $param .= '&search_user='.((int) $search_user); |
|
942 | 942 | } |
943 | 943 | if ($search_month) { |
944 | - $param .= '&search_month=' . ((int) $search_month); |
|
944 | + $param .= '&search_month='.((int) $search_month); |
|
945 | 945 | } |
946 | 946 | if ($search_year) { |
947 | - $param .= '&search_year=' . ((int) $search_year); |
|
947 | + $param .= '&search_year='.((int) $search_year); |
|
948 | 948 | } |
949 | 949 | |
950 | 950 | // Project card |
@@ -956,14 +956,14 @@ discard block |
||
956 | 956 | $morehtmlref .= $projectstatic->title; |
957 | 957 | // Thirdparty |
958 | 958 | if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { |
959 | - $morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
959 | + $morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
960 | 960 | } |
961 | 961 | $morehtmlref .= '</div>'; |
962 | 962 | |
963 | 963 | // Define a complementary filter for search of next/prev ref. |
964 | 964 | if (!$user->hasRight('projet', 'all', 'lire')) { |
965 | 965 | $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); |
966 | - $projectstatic->next_prev_filter = "rowid:IN:" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); |
|
966 | + $projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); |
|
967 | 967 | } |
968 | 968 | |
969 | 969 | dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); |
@@ -981,25 +981,25 @@ discard block |
||
981 | 981 | print '</td>'; |
982 | 982 | print '<td>'; |
983 | 983 | if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { |
984 | - print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> '; |
|
984 | + print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> '; |
|
985 | 985 | $htmltext = $langs->trans("ProjectFollowOpportunity"); |
986 | 986 | print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); |
987 | 987 | print '<br>'; |
988 | 988 | } |
989 | 989 | if (!getDolGlobalString('PROJECT_HIDE_TASKS')) { |
990 | - print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> '; |
|
990 | + print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> '; |
|
991 | 991 | $htmltext = $langs->trans("ProjectFollowTasks"); |
992 | 992 | print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); |
993 | 993 | print '<br>'; |
994 | 994 | } |
995 | 995 | if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) { |
996 | - 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"' : '')) . '"> '; |
|
996 | + 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"' : '')).'"> '; |
|
997 | 997 | $htmltext = $langs->trans("ProjectBillTimeDescription"); |
998 | 998 | print $form->textwithpicto($langs->trans("BillTime"), $htmltext); |
999 | 999 | print '<br>'; |
1000 | 1000 | } |
1001 | 1001 | if (isModEnabled('eventorganization')) { |
1002 | - 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"' : '')) . '"> '; |
|
1002 | + 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"' : '')).'"> '; |
|
1003 | 1003 | $htmltext = $langs->trans("EventOrganizationDescriptionLong"); |
1004 | 1004 | print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); |
1005 | 1005 | } |
@@ -1007,14 +1007,14 @@ discard block |
||
1007 | 1007 | } |
1008 | 1008 | |
1009 | 1009 | // Budget |
1010 | - print '<tr><td>' . $langs->trans("Budget") . '</td><td>'; |
|
1010 | + print '<tr><td>'.$langs->trans("Budget").'</td><td>'; |
|
1011 | 1011 | if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { |
1012 | - print '<span class="amount">' . price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency) . '</span>'; |
|
1012 | + print '<span class="amount">'.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>'; |
|
1013 | 1013 | } |
1014 | 1014 | print '</td></tr>'; |
1015 | 1015 | |
1016 | 1016 | // Date start - end project |
1017 | - print '<tr><td>' . $langs->trans("Dates") . '</td><td>'; |
|
1017 | + print '<tr><td>'.$langs->trans("Dates").'</td><td>'; |
|
1018 | 1018 | $start = dol_print_date($projectstatic->date_start, 'day'); |
1019 | 1019 | print($start ? $start : '?'); |
1020 | 1020 | $end = dol_print_date($projectstatic->date_end, 'day'); |
@@ -1026,7 +1026,7 @@ discard block |
||
1026 | 1026 | print '</td></tr>'; |
1027 | 1027 | |
1028 | 1028 | // Visibility |
1029 | - print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>'; |
|
1029 | + print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>'; |
|
1030 | 1030 | if ($projectstatic->public) { |
1031 | 1031 | print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"'); |
1032 | 1032 | print $langs->trans('SharedProject'); |
@@ -1040,7 +1040,7 @@ discard block |
||
1040 | 1040 | $cols = 2; |
1041 | 1041 | $savobject = $object; |
1042 | 1042 | $object = $projectstatic; |
1043 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
1043 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
1044 | 1044 | $object = $savobject; |
1045 | 1045 | |
1046 | 1046 | print '</table>'; |
@@ -1053,7 +1053,7 @@ discard block |
||
1053 | 1053 | |
1054 | 1054 | // Categories |
1055 | 1055 | if (isModEnabled('category')) { |
1056 | - print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>'; |
|
1056 | + print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>'; |
|
1057 | 1057 | print $form->showCategories($projectstatic->id, 'project', 1); |
1058 | 1058 | print "</td></tr>"; |
1059 | 1059 | } |
@@ -1092,12 +1092,12 @@ discard block |
||
1092 | 1092 | |
1093 | 1093 | if (!empty($projectidforalltimes)) { |
1094 | 1094 | // We are on tab 'Time Spent' of project |
1095 | - $backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : ''); |
|
1096 | - $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
1095 | + $backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : ''); |
|
1096 | + $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
1097 | 1097 | } else { |
1098 | 1098 | // We are on tab 'Time Spent' of task |
1099 | - $backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : ''); |
|
1100 | - $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . ($object->id > 0 ? '&id=' . $object->id : '&projectid=' . $projectstatic->id) . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
1099 | + $backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : ''); |
|
1100 | + $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
1101 | 1101 | } |
1102 | 1102 | } else { |
1103 | 1103 | $linktocreatetimeBtnStatus = -2; |
@@ -1142,19 +1142,19 @@ discard block |
||
1142 | 1142 | print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition'); |
1143 | 1143 | |
1144 | 1144 | if ($action == 'deleteline') { |
1145 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : ''); |
|
1145 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : ''); |
|
1146 | 1146 | print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
1147 | 1147 | } |
1148 | 1148 | |
1149 | 1149 | $param = ($withproject ? '&withproject=1' : ''); |
1150 | - $param .= ($param ? '&' : '') . 'id=' . $object->id; // ID of task |
|
1151 | - $linkback = $withproject ? '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . '">' . $langs->trans("BackToList") . '</a>' : ''; |
|
1150 | + $param .= ($param ? '&' : '').'id='.$object->id; // ID of task |
|
1151 | + $linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : ''; |
|
1152 | 1152 | |
1153 | 1153 | if (!GETPOST('withproject') || empty($projectstatic->id)) { |
1154 | 1154 | $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); |
1155 | - $object->next_prev_filter = "fk_projet:IN:" . $db->sanitize($projectsListId); |
|
1155 | + $object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId); |
|
1156 | 1156 | } else { |
1157 | - $object->next_prev_filter = "fk_projet:=:" . ((int) $projectstatic->id); |
|
1157 | + $object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id); |
|
1158 | 1158 | } |
1159 | 1159 | |
1160 | 1160 | $morehtmlref = ''; |
@@ -1162,12 +1162,12 @@ discard block |
||
1162 | 1162 | // Project |
1163 | 1163 | if (empty($withproject)) { |
1164 | 1164 | $morehtmlref .= '<div class="refidno">'; |
1165 | - $morehtmlref .= $langs->trans("Project") . ': '; |
|
1165 | + $morehtmlref .= $langs->trans("Project").': '; |
|
1166 | 1166 | $morehtmlref .= $projectstatic->getNomUrl(1); |
1167 | 1167 | $morehtmlref .= '<br>'; |
1168 | 1168 | |
1169 | 1169 | // Third party |
1170 | - $morehtmlref .= $langs->trans("ThirdParty") . ': '; |
|
1170 | + $morehtmlref .= $langs->trans("ThirdParty").': '; |
|
1171 | 1171 | if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) { |
1172 | 1172 | $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); |
1173 | 1173 | } |
@@ -1183,7 +1183,7 @@ discard block |
||
1183 | 1183 | print '<table class="border centpercent tableforfield">'; |
1184 | 1184 | |
1185 | 1185 | // Task parent |
1186 | - print '<tr><td>' . $langs->trans("ChildOfTask") . '</td><td>'; |
|
1186 | + print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>'; |
|
1187 | 1187 | if ($object->fk_task_parent > 0) { |
1188 | 1188 | $tasktmp = new Task($db); |
1189 | 1189 | $tasktmp->fetch($object->fk_task_parent); |
@@ -1192,7 +1192,7 @@ discard block |
||
1192 | 1192 | print '</td></tr>'; |
1193 | 1193 | |
1194 | 1194 | // Date start - Date end task |
1195 | - print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>'; |
|
1195 | + print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>'; |
|
1196 | 1196 | $start = dol_print_date($object->date_start, 'dayhour'); |
1197 | 1197 | print($start ? $start : '?'); |
1198 | 1198 | $end = dol_print_date($object->date_end, 'dayhour'); |
@@ -1204,7 +1204,7 @@ discard block |
||
1204 | 1204 | print '</td></tr>'; |
1205 | 1205 | |
1206 | 1206 | // Planned workload |
1207 | - print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>'; |
|
1207 | + print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>'; |
|
1208 | 1208 | if ($object->planned_workload) { |
1209 | 1209 | print convertSecondToTime($object->planned_workload, 'allhourmin'); |
1210 | 1210 | } |
@@ -1219,21 +1219,21 @@ discard block |
||
1219 | 1219 | print '<table class="border tableforfield centpercent">'; |
1220 | 1220 | |
1221 | 1221 | // Progress declared |
1222 | - print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>'; |
|
1223 | - print $object->progress != '' ? $object->progress . ' %' : ''; |
|
1222 | + print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>'; |
|
1223 | + print $object->progress != '' ? $object->progress.' %' : ''; |
|
1224 | 1224 | print '</td></tr>'; |
1225 | 1225 | |
1226 | 1226 | // Progress calculated |
1227 | - print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>'; |
|
1227 | + print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>'; |
|
1228 | 1228 | if ($object->planned_workload) { |
1229 | 1229 | $tmparray = $object->getSummaryOfTimeSpent(); |
1230 | 1230 | if ($tmparray['total_duration'] > 0) { |
1231 | - print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %'; |
|
1231 | + print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %'; |
|
1232 | 1232 | } else { |
1233 | 1233 | print '0 %'; |
1234 | 1234 | } |
1235 | 1235 | } else { |
1236 | - print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>'; |
|
1236 | + print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>'; |
|
1237 | 1237 | } |
1238 | 1238 | print '</td>'; |
1239 | 1239 | |
@@ -1249,7 +1249,7 @@ discard block |
||
1249 | 1249 | print dol_get_fiche_end(); |
1250 | 1250 | } else { |
1251 | 1251 | if ($action == 'deleteline') { |
1252 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : ''); |
|
1252 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : ''); |
|
1253 | 1253 | print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
1254 | 1254 | } |
1255 | 1255 | } |
@@ -1263,7 +1263,7 @@ discard block |
||
1263 | 1263 | |
1264 | 1264 | if ($action == 'deleteline' && !empty($projectidforalltimes)) { |
1265 | 1265 | // We must use projectidprojectid if on list of timespent of project and id=taskid if on list of timespent of a task |
1266 | - $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); |
|
1266 | + $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); |
|
1267 | 1267 | $formconfirm = $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
1268 | 1268 | } |
1269 | 1269 | |
@@ -1282,10 +1282,10 @@ discard block |
||
1282 | 1282 | // Definition of fields for list |
1283 | 1283 | $arrayfields = array(); |
1284 | 1284 | $arrayfields['t.element_date'] = array('label' => $langs->trans("Date"), 'checked' => 1); |
1285 | - $arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1','checked' => 1); |
|
1285 | + $arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1', 'checked' => 1); |
|
1286 | 1286 | $arrayfields['s.name_alias'] = array('label' => $langs->trans("AliasNameShort"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1'); |
1287 | 1287 | if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task |
1288 | - if (! empty($allprojectforuser)) { |
|
1288 | + if (!empty($allprojectforuser)) { |
|
1289 | 1289 | $arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1]; |
1290 | 1290 | $arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1]; |
1291 | 1291 | } |
@@ -1301,83 +1301,83 @@ discard block |
||
1301 | 1301 | $arrayfields['value'] = array('label' => $langs->trans("Value"), 'checked' => 1, 'enabled' => isModEnabled("salaries")); |
1302 | 1302 | $arrayfields['valuebilled'] = array('label' => $langs->trans("Billed"), 'checked' => 1, 'enabled' => (((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time)); |
1303 | 1303 | // Extra fields |
1304 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
1304 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
1305 | 1305 | |
1306 | 1306 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
1307 | - '@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
1307 | + '@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
1308 | 1308 | |
1309 | 1309 | $param = ''; |
1310 | 1310 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
1311 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
1311 | + $param .= '&contextpage='.urlencode($contextpage); |
|
1312 | 1312 | } |
1313 | 1313 | if ($limit > 0 && $limit != $conf->liste_limit) { |
1314 | 1314 | $param .= '&limit='.((int) $limit); |
1315 | 1315 | } |
1316 | 1316 | if ($search_month > 0) { |
1317 | - $param .= '&search_month=' . urlencode((string) ($search_month)); |
|
1317 | + $param .= '&search_month='.urlencode((string) ($search_month)); |
|
1318 | 1318 | } |
1319 | 1319 | if ($search_year > 0) { |
1320 | - $param .= '&search_year=' . urlencode((string) ($search_year)); |
|
1320 | + $param .= '&search_year='.urlencode((string) ($search_year)); |
|
1321 | 1321 | } |
1322 | 1322 | if (!empty($search_user)) { // We keep param if -1 because default value is forced to user id if not set |
1323 | 1323 | $param .= '&search_user='.urlencode($search_user); |
1324 | 1324 | } |
1325 | 1325 | if ($search_task_ref != '') { |
1326 | - $param .= '&search_task_ref=' . urlencode($search_task_ref); |
|
1326 | + $param .= '&search_task_ref='.urlencode($search_task_ref); |
|
1327 | 1327 | } |
1328 | 1328 | if ($search_company != '') { |
1329 | - $param .= '&$search_company=' . urlencode($search_company); |
|
1329 | + $param .= '&$search_company='.urlencode($search_company); |
|
1330 | 1330 | } |
1331 | 1331 | if ($search_company_alias != '') { |
1332 | - $param .= '&$search_company_alias=' . urlencode($search_company_alias); |
|
1332 | + $param .= '&$search_company_alias='.urlencode($search_company_alias); |
|
1333 | 1333 | } |
1334 | 1334 | if ($search_project_ref != '') { |
1335 | - $param .= '&$search_project_ref=' . urlencode($search_project_ref); |
|
1335 | + $param .= '&$search_project_ref='.urlencode($search_project_ref); |
|
1336 | 1336 | } |
1337 | 1337 | if ($search_project_label != '') { |
1338 | - $param .= '&$search_project_label=' . urlencode($search_project_label); |
|
1338 | + $param .= '&$search_project_label='.urlencode($search_project_label); |
|
1339 | 1339 | } |
1340 | 1340 | if ($search_task_label != '') { |
1341 | - $param .= '&search_task_label=' . urlencode($search_task_label); |
|
1341 | + $param .= '&search_task_label='.urlencode($search_task_label); |
|
1342 | 1342 | } |
1343 | 1343 | if ($search_note != '') { |
1344 | - $param .= '&search_note=' . urlencode($search_note); |
|
1344 | + $param .= '&search_note='.urlencode($search_note); |
|
1345 | 1345 | } |
1346 | 1346 | if ($search_duration != '') { |
1347 | - $param .= '&search_field2=' . urlencode((string) ($search_duration)); |
|
1347 | + $param .= '&search_field2='.urlencode((string) ($search_duration)); |
|
1348 | 1348 | } |
1349 | 1349 | if ($optioncss != '') { |
1350 | - $param .= '&optioncss=' . urlencode($optioncss); |
|
1350 | + $param .= '&optioncss='.urlencode($optioncss); |
|
1351 | 1351 | } |
1352 | 1352 | if ($search_date_startday) { |
1353 | - $param .= '&search_date_startday=' . urlencode((string) ($search_date_startday)); |
|
1353 | + $param .= '&search_date_startday='.urlencode((string) ($search_date_startday)); |
|
1354 | 1354 | } |
1355 | 1355 | if ($search_date_startmonth) { |
1356 | - $param .= '&search_date_startmonth=' . urlencode((string) ($search_date_startmonth)); |
|
1356 | + $param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth)); |
|
1357 | 1357 | } |
1358 | 1358 | if ($search_date_startyear) { |
1359 | - $param .= '&search_date_startyear=' . urlencode((string) ($search_date_startyear)); |
|
1359 | + $param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear)); |
|
1360 | 1360 | } |
1361 | 1361 | if ($search_date_endday) { |
1362 | - $param .= '&search_date_endday=' . urlencode((string) ($search_date_endday)); |
|
1362 | + $param .= '&search_date_endday='.urlencode((string) ($search_date_endday)); |
|
1363 | 1363 | } |
1364 | 1364 | if ($search_date_endmonth) { |
1365 | - $param .= '&search_date_endmonth=' . urlencode((string) ($search_date_endmonth)); |
|
1365 | + $param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth)); |
|
1366 | 1366 | } |
1367 | 1367 | if ($search_date_endyear) { |
1368 | - $param .= '&search_date_endyear=' . urlencode((string) ($search_date_endyear)); |
|
1368 | + $param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear)); |
|
1369 | 1369 | } |
1370 | 1370 | if ($search_timespent_starthour) { |
1371 | - $param .= '&search_timespent_duration_starthour=' . urlencode((string) ($search_timespent_starthour)); |
|
1371 | + $param .= '&search_timespent_duration_starthour='.urlencode((string) ($search_timespent_starthour)); |
|
1372 | 1372 | } |
1373 | 1373 | if ($search_timespent_startmin) { |
1374 | - $param .= '&search_timespent_duration_startmin=' . urlencode((string) ($search_timespent_startmin)); |
|
1374 | + $param .= '&search_timespent_duration_startmin='.urlencode((string) ($search_timespent_startmin)); |
|
1375 | 1375 | } |
1376 | 1376 | if ($search_timespent_endhour) { |
1377 | - $param .= '&search_timespent_duration_endhour=' . urlencode((string) ($search_timespent_endhour)); |
|
1377 | + $param .= '&search_timespent_duration_endhour='.urlencode((string) ($search_timespent_endhour)); |
|
1378 | 1378 | } |
1379 | 1379 | if ($search_timespent_endmin) { |
1380 | - $param .= '&search_timespent_duration_endmin=' . urlencode((string) ($search_timespent_endmin)); |
|
1380 | + $param .= '&search_timespent_duration_endmin='.urlencode((string) ($search_timespent_endmin)); |
|
1381 | 1381 | } |
1382 | 1382 | |
1383 | 1383 | /* |
@@ -1385,24 +1385,24 @@ discard block |
||
1385 | 1385 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
1386 | 1386 | */ |
1387 | 1387 | if ($id) { |
1388 | - $param .= '&id=' . urlencode((string) ($id)); |
|
1388 | + $param .= '&id='.urlencode((string) ($id)); |
|
1389 | 1389 | } |
1390 | 1390 | if ($projectid) { |
1391 | - $param .= '&projectid=' . urlencode((string) ($projectid)); |
|
1391 | + $param .= '&projectid='.urlencode((string) ($projectid)); |
|
1392 | 1392 | } |
1393 | 1393 | if ($withproject) { |
1394 | - $param .= '&withproject=' . urlencode((string) ($withproject)); |
|
1394 | + $param .= '&withproject='.urlencode((string) ($withproject)); |
|
1395 | 1395 | } |
1396 | 1396 | // Add $param from hooks |
1397 | 1397 | $parameters = array('param' => &$param); |
1398 | 1398 | $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
1399 | 1399 | $param .= $hookmanager->resPrint; |
1400 | 1400 | |
1401 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
1401 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
1402 | 1402 | if ($optioncss != '') { |
1403 | - print '<input type="hidden" name="optioncss" value="' . $optioncss . '">'; |
|
1403 | + print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
|
1404 | 1404 | } |
1405 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
1405 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1406 | 1406 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
1407 | 1407 | if ($action == 'editline') { |
1408 | 1408 | print '<input type="hidden" name="action" value="updateline">'; |
@@ -1417,13 +1417,13 @@ discard block |
||
1417 | 1417 | } else { |
1418 | 1418 | print '<input type="hidden" name="action" value="list">'; |
1419 | 1419 | } |
1420 | - print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
1421 | - print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
1420 | + print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
1421 | + print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
1422 | 1422 | |
1423 | - print '<input type="hidden" name="id" value="' . $id . '">'; |
|
1424 | - print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">'; |
|
1425 | - print '<input type="hidden" name="withproject" value="' . $withproject . '">'; |
|
1426 | - print '<input type="hidden" name="tab" value="' . $tab . '">'; |
|
1423 | + print '<input type="hidden" name="id" value="'.$id.'">'; |
|
1424 | + print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">'; |
|
1425 | + print '<input type="hidden" name="withproject" value="'.$withproject.'">'; |
|
1426 | + print '<input type="hidden" name="tab" value="'.$tab.'">'; |
|
1427 | 1427 | print '<input type="hidden" name="page_y" value="">'; |
1428 | 1428 | |
1429 | 1429 | // Form to convert time spent into invoice |
@@ -1450,7 +1450,7 @@ discard block |
||
1450 | 1450 | 'onelineperperiod' => 'OneLinePerTimeSpentLine', |
1451 | 1451 | ); |
1452 | 1452 | print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1); |
1453 | - print "\n" . '<script type="text/javascript">'; |
|
1453 | + print "\n".'<script type="text/javascript">'; |
|
1454 | 1454 | print ' |
1455 | 1455 | $(document).ready(function () { |
1456 | 1456 | setDetailVisibility(); |
@@ -1467,8 +1467,8 @@ discard block |
||
1467 | 1467 | } |
1468 | 1468 | }); |
1469 | 1469 | '; |
1470 | - print '</script>' . "\n"; |
|
1471 | - print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>'; |
|
1470 | + print '</script>'."\n"; |
|
1471 | + print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>'; |
|
1472 | 1472 | print '</td>'; |
1473 | 1473 | print '</tr>'; |
1474 | 1474 | |
@@ -1518,14 +1518,14 @@ discard block |
||
1518 | 1518 | |
1519 | 1519 | print '<br>'; |
1520 | 1520 | print '<div class="center">'; |
1521 | - print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '"> '; |
|
1522 | - print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
1521 | + print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'"> '; |
|
1522 | + print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
1523 | 1523 | print '</div>'; |
1524 | 1524 | print '<br>'; |
1525 | 1525 | } else { |
1526 | - print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>'; |
|
1526 | + print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>'; |
|
1527 | 1527 | print '<div class="center">'; |
1528 | - print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
1528 | + print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
1529 | 1529 | print '</div>'; |
1530 | 1530 | $massaction = ''; |
1531 | 1531 | } |
@@ -1538,7 +1538,7 @@ discard block |
||
1538 | 1538 | print '<table class="noborder centpercent">'; |
1539 | 1539 | print '<tr>'; |
1540 | 1540 | print '<td class="titlefield">'; |
1541 | - print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse'); |
|
1541 | + print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse'); |
|
1542 | 1542 | print '</td>'; |
1543 | 1543 | print '<td>'; |
1544 | 1544 | $forminter = new FormIntervention($db); |
@@ -1548,14 +1548,14 @@ discard block |
||
1548 | 1548 | print '</table>'; |
1549 | 1549 | |
1550 | 1550 | print '<div class="center">'; |
1551 | - print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '"> '; |
|
1552 | - print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
1551 | + print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'"> '; |
|
1552 | + print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
1553 | 1553 | print '</div>'; |
1554 | 1554 | print '<br>'; |
1555 | 1555 | } else { |
1556 | - print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>'; |
|
1556 | + print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>'; |
|
1557 | 1557 | print '<div class="center">'; |
1558 | - print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
1558 | + print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
1559 | 1559 | print '</div>'; |
1560 | 1560 | $massaction = ''; |
1561 | 1561 | } |
@@ -1625,14 +1625,14 @@ discard block |
||
1625 | 1625 | $sql .= " AND t.fk_element =".((int) $object->id); |
1626 | 1626 | } elseif (!empty($projectidforalltimes)) { |
1627 | 1627 | // Limit on one project |
1628 | - $sql .= " AND pt.fk_projet IN (" . $db->sanitize($projectidforalltimes) . ")"; |
|
1628 | + $sql .= " AND pt.fk_projet IN (".$db->sanitize($projectidforalltimes).")"; |
|
1629 | 1629 | } elseif (!empty($allprojectforuser)) { |
1630 | 1630 | // Limit on on user |
1631 | 1631 | if (empty($search_user)) { |
1632 | 1632 | $search_user = $user->id; |
1633 | 1633 | } |
1634 | 1634 | if ($search_user > 0) { |
1635 | - $sql .= " AND t.fk_user = " . ((int) $search_user); |
|
1635 | + $sql .= " AND t.fk_user = ".((int) $search_user); |
|
1636 | 1636 | } |
1637 | 1637 | } |
1638 | 1638 | |
@@ -1685,13 +1685,13 @@ discard block |
||
1685 | 1685 | if ($search_timespent_starthour || $search_timespent_startmin) { |
1686 | 1686 | $timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds |
1687 | 1687 | $timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds |
1688 | - $sql .= " AND t.element_duration >= " . $timespent_duration_start; |
|
1688 | + $sql .= " AND t.element_duration >= ".$timespent_duration_start; |
|
1689 | 1689 | } |
1690 | 1690 | |
1691 | 1691 | if ($search_timespent_endhour || $search_timespent_endmin) { |
1692 | 1692 | $timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds |
1693 | 1693 | $timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds |
1694 | - $sql .= " AND t.element_duration <= " . $timespent_duration_end; |
|
1694 | + $sql .= " AND t.element_duration <= ".$timespent_duration_end; |
|
1695 | 1695 | } |
1696 | 1696 | } |
1697 | 1697 | |
@@ -1739,13 +1739,13 @@ discard block |
||
1739 | 1739 | |
1740 | 1740 | if ($num >= 0) { |
1741 | 1741 | if (!empty($projectidforalltimes)) { |
1742 | - print '<!-- List of time spent for project -->' . "\n"; |
|
1742 | + print '<!-- List of time spent for project -->'."\n"; |
|
1743 | 1743 | |
1744 | 1744 | $title = $langs->trans("ListTaskTimeUserProject"); |
1745 | 1745 | |
1746 | 1746 | print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1); |
1747 | 1747 | } else { |
1748 | - print '<!-- List of time spent -->' . "\n"; |
|
1748 | + print '<!-- List of time spent -->'."\n"; |
|
1749 | 1749 | |
1750 | 1750 | $title = $langs->trans("ListTaskTimeForTask"); |
1751 | 1751 | |
@@ -1767,26 +1767,26 @@ discard block |
||
1767 | 1767 | * Form to add a new line of time spent |
1768 | 1768 | */ |
1769 | 1769 | if ($action == 'createtime' && $user->hasRight('projet', 'time')) { |
1770 | - print '<!-- table to add time spent -->' . "\n"; |
|
1770 | + print '<!-- table to add time spent -->'."\n"; |
|
1771 | 1771 | if (!empty($id)) { |
1772 | - print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
1772 | + print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
1773 | 1773 | } |
1774 | 1774 | |
1775 | 1775 | 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 |
1776 | 1776 | print '<table class="noborder nohover centpercent">'; |
1777 | 1777 | |
1778 | 1778 | print '<tr class="liste_titre">'; |
1779 | - print '<td>' . $langs->trans("Date") . '</td>'; |
|
1779 | + print '<td>'.$langs->trans("Date").'</td>'; |
|
1780 | 1780 | if (!empty($allprojectforuser)) { |
1781 | - print '<td>' . $langs->trans("Project") . '</td>'; |
|
1781 | + print '<td>'.$langs->trans("Project").'</td>'; |
|
1782 | 1782 | } |
1783 | 1783 | if (empty($id)) { |
1784 | - print '<td>' . $langs->trans("Task") . '</td>'; |
|
1784 | + print '<td>'.$langs->trans("Task").'</td>'; |
|
1785 | 1785 | } |
1786 | - print '<td>' . $langs->trans("By") . '</td>'; |
|
1787 | - print '<td>' . $langs->trans("Note") . '</td>'; |
|
1788 | - print '<td>' . $langs->trans("NewTimeSpent") . '</td>'; |
|
1789 | - print '<td>' . $langs->trans("ProgressDeclared") . '</td>'; |
|
1786 | + print '<td>'.$langs->trans("By").'</td>'; |
|
1787 | + print '<td>'.$langs->trans("Note").'</td>'; |
|
1788 | + print '<td>'.$langs->trans("NewTimeSpent").'</td>'; |
|
1789 | + print '<td>'.$langs->trans("ProgressDeclared").'</td>'; |
|
1790 | 1790 | if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) { |
1791 | 1791 | print '<td></td>'; |
1792 | 1792 | |
@@ -1840,14 +1840,14 @@ discard block |
||
1840 | 1840 | print $form->select_dolusers((GETPOSTINT('userid') ? GETPOSTINT('userid') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200'); |
1841 | 1841 | } else { |
1842 | 1842 | if ($nboftasks) { |
1843 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
1843 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime'); |
|
1844 | 1844 | } |
1845 | 1845 | } |
1846 | 1846 | print '</td>'; |
1847 | 1847 | |
1848 | 1848 | // Note |
1849 | 1849 | print '<td>'; |
1850 | - print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>'; |
|
1850 | + print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>'; |
|
1851 | 1851 | print '</td>'; |
1852 | 1852 | |
1853 | 1853 | // Duration - Time spent |
@@ -1915,7 +1915,7 @@ discard block |
||
1915 | 1915 | $selectedfields .= (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
1916 | 1916 | |
1917 | 1917 | print '<div class="div-table-responsive">'; |
1918 | - print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
|
1918 | + print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; |
|
1919 | 1919 | |
1920 | 1920 | // Fields title search |
1921 | 1921 | // -------------------------------------------------------------------- |
@@ -1940,20 +1940,20 @@ discard block |
||
1940 | 1940 | } |
1941 | 1941 | // Thirdparty |
1942 | 1942 | if (!empty($arrayfields['p.fk_soc']['checked'])) { |
1943 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>'; |
|
1943 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>'; |
|
1944 | 1944 | } |
1945 | 1945 | |
1946 | 1946 | // Thirdparty alias |
1947 | 1947 | if (!empty($arrayfields['s.name_alias']['checked'])) { |
1948 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>'; |
|
1948 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>'; |
|
1949 | 1949 | } |
1950 | 1950 | |
1951 | 1951 | if (!empty($allprojectforuser)) { |
1952 | 1952 | if (!empty($arrayfields['p.project_ref']['checked'])) { |
1953 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>'; |
|
1953 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>'; |
|
1954 | 1954 | } |
1955 | 1955 | if (!empty($arrayfields['p.project_label']['checked'])) { |
1956 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>'; |
|
1956 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>'; |
|
1957 | 1957 | } |
1958 | 1958 | } |
1959 | 1959 | // Task |
@@ -1971,7 +1971,7 @@ discard block |
||
1971 | 1971 | } |
1972 | 1972 | // Note |
1973 | 1973 | if (!empty($arrayfields['t.note']['checked'])) { |
1974 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>'; |
|
1974 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>'; |
|
1975 | 1975 | } |
1976 | 1976 | // Duration |
1977 | 1977 | if (!empty($arrayfields['t.element_duration']['checked'])) { |
@@ -1982,7 +1982,7 @@ discard block |
||
1982 | 1982 | if ($search_timespent_starthour || $search_timespent_startmin) { |
1983 | 1983 | $durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60); |
1984 | 1984 | } |
1985 | - print '<div class="nowraponall">' . $langs->trans('from') . ' '; |
|
1985 | + print '<div class="nowraponall">'.$langs->trans('from').' '; |
|
1986 | 1986 | print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1); |
1987 | 1987 | print '</div>'; |
1988 | 1988 | |
@@ -1990,7 +1990,7 @@ discard block |
||
1990 | 1990 | if ($search_timespent_endhour || $search_timespent_endmin) { |
1991 | 1991 | $durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60); |
1992 | 1992 | } |
1993 | - print '<div class="nowraponall">' . $langs->trans('to') . ' '; |
|
1993 | + print '<div class="nowraponall">'.$langs->trans('to').' '; |
|
1994 | 1994 | print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1); |
1995 | 1995 | print '</div>'; |
1996 | 1996 | |
@@ -2006,7 +2006,7 @@ discard block |
||
2006 | 2006 | } |
2007 | 2007 | // Value billed |
2008 | 2008 | if (!empty($arrayfields['valuebilled']['checked'])) { |
2009 | - print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>'; |
|
2009 | + print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>'; |
|
2010 | 2010 | } |
2011 | 2011 | |
2012 | 2012 | /* |
@@ -2024,7 +2024,7 @@ discard block |
||
2024 | 2024 | print $searchpicto; |
2025 | 2025 | print '</td>'; |
2026 | 2026 | } |
2027 | - print '</tr>' . "\n"; |
|
2027 | + print '</tr>'."\n"; |
|
2028 | 2028 | |
2029 | 2029 | |
2030 | 2030 | $totalarray = array(); |
@@ -2142,7 +2142,7 @@ discard block |
||
2142 | 2142 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
2143 | 2143 | print '<td class="center nowraponall">'; |
2144 | 2144 | if (($action == 'editline' || $action == 'splitline') && GETPOSTINT('lineid') == $task_time->rowid) { |
2145 | - print '<input type="hidden" name="lineid" value="' . GETPOSTINT('lineid') . '">'; |
|
2145 | + print '<input type="hidden" name="lineid" value="'.GETPOSTINT('lineid').'">'; |
|
2146 | 2146 | print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">'; |
2147 | 2147 | print '<br>'; |
2148 | 2148 | print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
@@ -2153,7 +2153,7 @@ discard block |
||
2153 | 2153 | print '</a>'; |
2154 | 2154 | |
2155 | 2155 | if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) { |
2156 | - 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' : '') . '">'; |
|
2156 | + 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' : '').'">'; |
|
2157 | 2157 | print img_split('', 'class="pictofixedwidth paddingleft"'); |
2158 | 2158 | print '</a>'; |
2159 | 2159 | } |
@@ -2171,12 +2171,12 @@ discard block |
||
2171 | 2171 | |
2172 | 2172 | // Disable select if task not billable or already invoiced |
2173 | 2173 | $disabled = (intval($task_time->billable) != 1 || $invoiced); |
2174 | - $ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
2174 | + $ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
2175 | 2175 | if ($disabled) { |
2176 | 2176 | // If disabled, a dbl-click very close outside the control |
2177 | 2177 | // will re-enable it, so that user is not blocked if needed. |
2178 | - print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>'; |
|
2179 | - print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>'; |
|
2178 | + print '<span id="cbsp'.$task_time->rowid.'">'.$ctrl.'</span>'; |
|
2179 | + print '<script>$("#cbsp'.$task_time->rowid.'").dblclick(()=>{ $("#cb'.$task_time->rowid.'").removeAttr("disabled") })</script>'; |
|
2180 | 2180 | } else { |
2181 | 2181 | print $ctrl; |
2182 | 2182 | } |
@@ -2298,7 +2298,7 @@ discard block |
||
2298 | 2298 | } |
2299 | 2299 | } |
2300 | 2300 | } elseif ($action !== 'createtime') { |
2301 | - print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
2301 | + print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
2302 | 2302 | } |
2303 | 2303 | |
2304 | 2304 | // Task label |
@@ -2327,9 +2327,9 @@ discard block |
||
2327 | 2327 | } |
2328 | 2328 | if (count($contactsoftask) > 0) { |
2329 | 2329 | print img_object('', 'user', 'class="pictofixedwidth hideonsmartphone"'); |
2330 | - 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 |
|
2330 | + 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 |
|
2331 | 2331 | } else { |
2332 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2332 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2333 | 2333 | } |
2334 | 2334 | } else { |
2335 | 2335 | $userstatic->id = $task_time->fk_user; |
@@ -2351,7 +2351,7 @@ discard block |
||
2351 | 2351 | if (!empty($arrayfields['t.note']['checked'])) { |
2352 | 2352 | if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) { |
2353 | 2353 | print '<td class="small">'; |
2354 | - print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2354 | + print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2355 | 2355 | print '</td>'; |
2356 | 2356 | } else { |
2357 | 2357 | print '<td class="small tdoverflowmax150 classfortooltip" title="'.dol_string_onlythesehtmltags(dol_htmlentitiesbr($task_time->note)).'">'; |
@@ -2362,7 +2362,7 @@ discard block |
||
2362 | 2362 | $totalarray['nbfield']++; |
2363 | 2363 | } |
2364 | 2364 | } elseif ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) { |
2365 | - print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2365 | + print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2366 | 2366 | } |
2367 | 2367 | |
2368 | 2368 | // Time spent |
@@ -2423,7 +2423,7 @@ discard block |
||
2423 | 2423 | $value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1); |
2424 | 2424 | |
2425 | 2425 | print '<td class="nowraponall right">'; |
2426 | - print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">'; |
|
2426 | + print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">'; |
|
2427 | 2427 | print price($value, 1, $langs, 1, -1, -1, $conf->currency); |
2428 | 2428 | print '</span>'; |
2429 | 2429 | print '</td>'; |
@@ -2479,7 +2479,7 @@ discard block |
||
2479 | 2479 | } |
2480 | 2480 | } |
2481 | 2481 | } else { |
2482 | - print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>'; |
|
2482 | + print '<span class="opacitymedium">'.$langs->trans("NA").'</span>'; |
|
2483 | 2483 | } |
2484 | 2484 | } |
2485 | 2485 | print '</td>'; |
@@ -2513,7 +2513,7 @@ discard block |
||
2513 | 2513 | print '</a>'; |
2514 | 2514 | |
2515 | 2515 | if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) { |
2516 | - 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' : '') . '">'; |
|
2516 | + 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' : '').'">'; |
|
2517 | 2517 | print img_split('', 'class="pictofixedwidth paddingleft"'); |
2518 | 2518 | print '</a>'; |
2519 | 2519 | } |
@@ -2531,12 +2531,12 @@ discard block |
||
2531 | 2531 | |
2532 | 2532 | // Disable select if task not billable or already invoiced |
2533 | 2533 | $disabled = (intval($task_time->billable) != 1 || $invoiced); |
2534 | - $ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
2534 | + $ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
2535 | 2535 | if ($disabled) { |
2536 | 2536 | // If disabled, a dbl-click very close outside the control |
2537 | 2537 | // will re-enable it, so that user is not blocked if needed. |
2538 | - print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>'; |
|
2539 | - print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>'; |
|
2538 | + print '<span id="cbsp'.$task_time->rowid.'">'.$ctrl.'</span>'; |
|
2539 | + print '<script>$("#cbsp'.$task_time->rowid.'").dblclick(()=>{ $("#cb'.$task_time->rowid.'").removeAttr("disabled") })</script>'; |
|
2540 | 2540 | } else { |
2541 | 2541 | print $ctrl; |
2542 | 2542 | } |
@@ -2635,7 +2635,7 @@ discard block |
||
2635 | 2635 | print img_object('', 'user', 'class="hideonsmartphone"'); |
2636 | 2636 | print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask); |
2637 | 2637 | } else { |
2638 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2638 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2639 | 2639 | } |
2640 | 2640 | } else { |
2641 | 2641 | $userstatic->id = $task_time->fk_user; |
@@ -2652,13 +2652,13 @@ discard block |
||
2652 | 2652 | if (!empty($arrayfields['t.note']['checked'])) { |
2653 | 2653 | print '<td class="tdoverflowmax300">'; |
2654 | 2654 | if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
2655 | - print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2655 | + print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2656 | 2656 | } else { |
2657 | 2657 | print dol_nl2br($task_time->note); |
2658 | 2658 | } |
2659 | 2659 | print '</td>'; |
2660 | 2660 | } elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
2661 | - print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_2 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2661 | + print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_2.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2662 | 2662 | } |
2663 | 2663 | |
2664 | 2664 | // Time spent |
@@ -2800,7 +2800,7 @@ discard block |
||
2800 | 2800 | print img_object('', 'user', 'class="hideonsmartphone"'); |
2801 | 2801 | print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, '', 0, '', $contactsoftask); |
2802 | 2802 | } else { |
2803 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2803 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2804 | 2804 | } |
2805 | 2805 | } else { |
2806 | 2806 | $userstatic->id = $task_time->fk_user; |
@@ -2817,13 +2817,13 @@ discard block |
||
2817 | 2817 | if (!empty($arrayfields['t.note']['checked'])) { |
2818 | 2818 | print '<td class="small tdoverflowmax300"">'; |
2819 | 2819 | if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
2820 | - print '<textarea name="timespent_note_line_2" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2820 | + print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2821 | 2821 | } else { |
2822 | 2822 | print dol_nl2br($task_time->note); |
2823 | 2823 | } |
2824 | 2824 | print '</td>'; |
2825 | 2825 | } elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
2826 | - print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2826 | + print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2827 | 2827 | } |
2828 | 2828 | |
2829 | 2829 | // Time spent |
@@ -2897,14 +2897,14 @@ discard block |
||
2897 | 2897 | $i++; |
2898 | 2898 | if ($i == 1) { |
2899 | 2899 | if ($num < $limit && empty($offset)) { |
2900 | - print '<td class="left">' . $langs->trans("Total") . '</td>'; |
|
2900 | + print '<td class="left">'.$langs->trans("Total").'</td>'; |
|
2901 | 2901 | } else { |
2902 | 2902 | print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>'; |
2903 | 2903 | } |
2904 | 2904 | } elseif (isset($totalarray['totaldurationfield']) && $totalarray['totaldurationfield'] == $i) { |
2905 | - print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>'; |
|
2905 | + print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>'; |
|
2906 | 2906 | } elseif (isset($totalarray['totalvaluefield']) && $totalarray['totalvaluefield'] == $i) { |
2907 | - print '<td class="right">' . price($totalarray['totalvalue']) . '</td>'; |
|
2907 | + print '<td class="right">'.price($totalarray['totalvalue']).'</td>'; |
|
2908 | 2908 | //} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>'; |
2909 | 2909 | } else { |
2910 | 2910 | print '<td></td>'; |
@@ -2920,8 +2920,8 @@ discard block |
||
2920 | 2920 | $totalnboffields++; |
2921 | 2921 | } |
2922 | 2922 | } |
2923 | - print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">'; |
|
2924 | - print '<span class="opacitymedium">' . $langs->trans("None") . '</span>'; |
|
2923 | + print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">'; |
|
2924 | + print '<span class="opacitymedium">'.$langs->trans("None").'</span>'; |
|
2925 | 2925 | print '</td></tr>'; |
2926 | 2926 | } |
2927 | 2927 |
@@ -155,9 +155,9 @@ discard block |
||
155 | 155 | $userstatic = new User($db); |
156 | 156 | $result = $projectstatic->fetch($object->fk_project); |
157 | 157 | |
158 | -$title = $object->ref . ' - ' . $langs->trans("Contacts"); |
|
158 | +$title = $object->ref.' - '.$langs->trans("Contacts"); |
|
159 | 159 | if (!empty($withproject)) { |
160 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '') ; |
|
160 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
161 | 161 | } |
162 | 162 | $help_url = ''; |
163 | 163 | |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | $cols = 2; |
290 | 290 | $savobject = $object; |
291 | 291 | $object = $projectstatic; |
292 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
292 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
293 | 293 | $object = $savobject; |
294 | 294 | |
295 | 295 | print '</table>'; |
@@ -131,9 +131,9 @@ discard block |
||
131 | 131 | */ |
132 | 132 | $form = new Form($db); |
133 | 133 | |
134 | -$title = $object->ref . ' - ' . $langs->trans("Documents"); |
|
134 | +$title = $object->ref.' - '.$langs->trans("Documents"); |
|
135 | 135 | if (!empty($withproject)) { |
136 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '') ; |
|
136 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
137 | 137 | } |
138 | 138 | $help_url = ''; |
139 | 139 | |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $cols = 2; |
247 | 247 | $savobject = $object; |
248 | 248 | $object = $projectstatic; |
249 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
249 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
250 | 250 | $object = $savobject; |
251 | 251 | |
252 | 252 | print '</table>'; |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | |
160 | 160 | if ($action == 'confirm_merge' && $confirm == 'yes' && $user->hasRight('projet', 'creer')) { |
161 | 161 | $task_origin_id = GETPOSTINT('task_origin'); |
162 | - $task_origin = new Task($db); // The Task that we will delete |
|
162 | + $task_origin = new Task($db); // The Task that we will delete |
|
163 | 163 | |
164 | 164 | if ($task_origin_id <= 0) { |
165 | 165 | $langs->load('errors'); |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | |
300 | 300 | $title = $object->ref; |
301 | 301 | if (!empty($withproject)) { |
302 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '') ; |
|
302 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
303 | 303 | } |
304 | 304 | $help_url = ''; |
305 | 305 | |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | $cols = 2; |
426 | 426 | $savobject = $object; |
427 | 427 | $object = $projectstatic; |
428 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
428 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
429 | 429 | $object = $savobject; |
430 | 430 | |
431 | 431 | print '</table>'; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | $object->fields = dol_sort_array($object->fields, 'position'); |
168 | 168 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
169 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
169 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
170 | 170 | |
171 | 171 | // Security check |
172 | 172 | $expeditionid = GETPOSTINT('id'); |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | } |
296 | 296 | |
297 | 297 | $objecttmp->date = $datefacture; |
298 | - $objecttmp->origin_type = 'shipping'; |
|
298 | + $objecttmp->origin_type = 'shipping'; |
|
299 | 299 | $objecttmp->origin_id = $id_sending; |
300 | 300 | |
301 | 301 | $objecttmp->array_options = $expd->array_options; // Copy extrafields |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | $desc = ($lines[$i]->desc ? $lines[$i]->desc : ''); |
363 | 363 | // If we build one invoice for several sendings, we must put the ref of sending on the invoice line |
364 | 364 | if (!empty($createbills_onebythird)) { |
365 | - $desc = dol_concatdesc($desc, $langs->trans("Order").': '.$expdCmdSrc->ref. ' - '. $langs->trans("Shipment").': '.$expd->ref.($expd->date_shipping ? ' - '.dol_print_date($expd->date_shipping, 'day') : '')); |
|
365 | + $desc = dol_concatdesc($desc, $langs->trans("Order").': '.$expdCmdSrc->ref.' - '.$langs->trans("Shipment").': '.$expd->ref.($expd->date_shipping ? ' - '.dol_print_date($expd->date_shipping, 'day') : '')); |
|
366 | 366 | } |
367 | 367 | |
368 | 368 | if ($lines[$i]->subprice < 0 && empty($conf->global->INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN)) { |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | if ($searchCategoryCustomerOperator == 0) { |
827 | 827 | $searchCategoryCustomerSqlList[] = " EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as cs WHERE s.rowid = cs.fk_soc AND cs.fk_categorie = ".((int) $searchCategoryCustomer).")"; |
828 | 828 | } else { |
829 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer); |
|
829 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryCustomer); |
|
830 | 830 | } |
831 | 831 | } |
832 | 832 | } |
@@ -856,7 +856,7 @@ discard block |
||
856 | 856 | if ($searchCategoryProductOperator == 0) { |
857 | 857 | $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."expeditiondet as ed, ".MAIN_DB_PREFIX."commandedet as cd WHERE ed.fk_expedition = e.rowid AND ed.fk_elementdet = cd.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; |
858 | 858 | } else { |
859 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); |
|
859 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProduct); |
|
860 | 860 | } |
861 | 861 | } |
862 | 862 | } |
@@ -1187,7 +1187,7 @@ discard block |
||
1187 | 1187 | } |
1188 | 1188 | |
1189 | 1189 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
1190 | -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // @phan-suppress-current-line PhanTypeMismatchArgument |
|
1190 | +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // @phan-suppress-current-line PhanTypeMismatchArgument |
|
1191 | 1191 | if ($massactionbutton) { |
1192 | 1192 | $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); // This also change content of $arrayfields |
1193 | 1193 | } |