@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | $object->delivery_date = $date_delivery; |
| 229 | 229 | foreach ($object->lines as $line) { |
| 230 | 230 | if (isset($line->date_start)) { |
| 231 | - $line->date_start += $difference; |
|
| 231 | + $line->date_start += $difference; |
|
| 232 | 232 | } |
| 233 | 233 | if (isset($line->date_end)) { |
| 234 | 234 | $line->date_end += $difference; |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | |
| 577 | 577 | $classname = ucfirst($subelement); |
| 578 | 578 | $srcobject = new $classname($db); |
| 579 | - '@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Can be other class, but CommonObject is too generic |
|
| 579 | + '@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Can be other class, but CommonObject is too generic |
|
| 580 | 580 | |
| 581 | 581 | dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); |
| 582 | 582 | $result = $srcobject->fetch($object->origin_id); |
@@ -766,7 +766,7 @@ discard block |
||
| 766 | 766 | $error++; |
| 767 | 767 | } else { |
| 768 | 768 | // Needed if object linked modified by trigger (because linked objects can't be fetched two times : linkedObjectsFullLoaded) |
| 769 | - $locationTarget = DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id; |
|
| 769 | + $locationTarget = DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id; |
|
| 770 | 770 | } |
| 771 | 771 | |
| 772 | 772 | $deposit = null; |
@@ -777,7 +777,7 @@ discard block |
||
| 777 | 777 | !$error && GETPOSTINT('statut') == $object::STATUS_SIGNED && GETPOST('generate_deposit') == 'on' |
| 778 | 778 | && !empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer') |
| 779 | 779 | ) { |
| 780 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 780 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 781 | 781 | |
| 782 | 782 | $date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear')); |
| 783 | 783 | $forceFields = array(); |
@@ -790,7 +790,7 @@ discard block |
||
| 790 | 790 | |
| 791 | 791 | if ($deposit) { |
| 792 | 792 | setEventMessage('DepositGenerated'); |
| 793 | - $locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id; |
|
| 793 | + $locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id; |
|
| 794 | 794 | } else { |
| 795 | 795 | $error++; |
| 796 | 796 | setEventMessages("Failed to create down payment - ".$object->error, $object->errors, 'errors'); |
@@ -818,7 +818,7 @@ discard block |
||
| 818 | 818 | } |
| 819 | 819 | |
| 820 | 820 | if ($locationTarget) { |
| 821 | - header('Location: ' . $locationTarget); |
|
| 821 | + header('Location: '.$locationTarget); |
|
| 822 | 822 | exit; |
| 823 | 823 | } |
| 824 | 824 | } else { |
@@ -1164,8 +1164,8 @@ discard block |
||
| 1164 | 1164 | $pricebycustomerexist = true; |
| 1165 | 1165 | $pu_ht = price($prodcustprice->lines[0]->price); |
| 1166 | 1166 | $pu_ttc = price($prodcustprice->lines[0]->price_ttc); |
| 1167 | - $price_min = price($prodcustprice->lines[0]->price_min); |
|
| 1168 | - $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
| 1167 | + $price_min = price($prodcustprice->lines[0]->price_min); |
|
| 1168 | + $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
| 1169 | 1169 | $price_base_type = $prodcustprice->lines[0]->price_base_type; |
| 1170 | 1170 | /*$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx.' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx); |
| 1171 | 1171 | if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) { |
@@ -1221,8 +1221,8 @@ discard block |
||
| 1221 | 1221 | if (count($prodcustprice->lines) > 0) { |
| 1222 | 1222 | $pu_ht = price($prodcustprice->lines[0]->price); |
| 1223 | 1223 | $pu_ttc = price($prodcustprice->lines[0]->price_ttc); |
| 1224 | - $price_min = price($prodcustprice->lines[0]->price_min); |
|
| 1225 | - $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
| 1224 | + $price_min = price($prodcustprice->lines[0]->price_min); |
|
| 1225 | + $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
| 1226 | 1226 | $price_base_type = $prodcustprice->lines[0]->price_base_type; |
| 1227 | 1227 | /*$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx.' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx); |
| 1228 | 1228 | if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) { |
@@ -1730,8 +1730,8 @@ discard block |
||
| 1730 | 1730 | } elseif ($action == 'setconditions' && $usercancreate) { |
| 1731 | 1731 | // Terms of payment |
| 1732 | 1732 | $sql = "SELECT code "; |
| 1733 | - $sql .= "FROM " . $db->prefix() . "c_payment_term"; |
|
| 1734 | - $sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int')); |
|
| 1733 | + $sql .= "FROM ".$db->prefix()."c_payment_term"; |
|
| 1734 | + $sql .= " WHERE rowid = ".((int) GETPOST('cond_reglement_id', 'int')); |
|
| 1735 | 1735 | $result = $db->query($sql); |
| 1736 | 1736 | if ($result) { |
| 1737 | 1737 | $obj = $db->fetch_object($result); |
@@ -1908,7 +1908,7 @@ discard block |
||
| 1908 | 1908 | |
| 1909 | 1909 | $classname = ucfirst($subelement); |
| 1910 | 1910 | $objectsrc = new $classname($db); |
| 1911 | - '@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic |
|
| 1911 | + '@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic |
|
| 1912 | 1912 | $objectsrc->fetch($originid); |
| 1913 | 1913 | if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) { |
| 1914 | 1914 | $objectsrc->fetch_lines(); |
@@ -1983,7 +1983,7 @@ discard block |
||
| 1983 | 1983 | print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
| 1984 | 1984 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
| 1985 | 1985 | print '<input type="hidden" name="action" value="add">'; |
| 1986 | - print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 1986 | + print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 1987 | 1987 | print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
| 1988 | 1988 | if ($origin != 'project' && $originid) { |
| 1989 | 1989 | print '<input type="hidden" name="origin" value="'.$origin.'">'; |
@@ -2145,7 +2145,7 @@ discard block |
||
| 2145 | 2145 | $sday = date("d", $tmpdte); |
| 2146 | 2146 | print $form->selectDate($syear."-".$smonth."-".$sday, 'date_livraison', 0, 0, 0, "addprop"); |
| 2147 | 2147 | } else { |
| 2148 | - $tmp_date_delivery = GETPOST('date_delivery') ? : -1; |
|
| 2148 | + $tmp_date_delivery = GETPOST('date_delivery') ?: -1; |
|
| 2149 | 2149 | print $form->selectDate($tmp_date_delivery, 'date_livraison', 0, 0, 0, "addprop", 1, 1); |
| 2150 | 2150 | } |
| 2151 | 2151 | print '</td></tr>'; |
@@ -2377,7 +2377,7 @@ discard block |
||
| 2377 | 2377 | if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) { |
| 2378 | 2378 | $formquestion[] = array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">'.$langs->trans("CloseAs").'</span>', 'values' => array($object::STATUS_SIGNED => $object->LibStatut($object::STATUS_SIGNED), $object::STATUS_NOTSIGNED => $object->LibStatut($object::STATUS_NOTSIGNED))); |
| 2379 | 2379 | } |
| 2380 | - $formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace) |
|
| 2380 | + $formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace) |
|
| 2381 | 2381 | |
| 2382 | 2382 | if (getDolGlobalInt('PROPOSAL_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) { |
| 2383 | 2383 | // This is a hidden option: |
@@ -2387,7 +2387,7 @@ discard block |
||
| 2387 | 2387 | $deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); |
| 2388 | 2388 | |
| 2389 | 2389 | if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) { |
| 2390 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 2390 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 2391 | 2391 | |
| 2392 | 2392 | $object->fetchObjectLinked(); |
| 2393 | 2393 | |
@@ -2471,7 +2471,7 @@ discard block |
||
| 2471 | 2471 | 'type' => 'onecolumn', |
| 2472 | 2472 | 'value' => ' |
| 2473 | 2473 | <script> |
| 2474 | - let signedValue = ' . $object::STATUS_SIGNED . '; |
|
| 2474 | + let signedValue = ' . $object::STATUS_SIGNED.'; |
|
| 2475 | 2475 | |
| 2476 | 2476 | $(document).ready(function() { |
| 2477 | 2477 | $("[name=generate_deposit]").change(function () { |
@@ -2521,7 +2521,7 @@ discard block |
||
| 2521 | 2521 | if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) { |
| 2522 | 2522 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250); |
| 2523 | 2523 | } else { |
| 2524 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250); |
|
| 2524 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?statut=3&id='.$object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250); |
|
| 2525 | 2525 | } |
| 2526 | 2526 | } elseif ($action == 'cancel') { |
| 2527 | 2527 | // Confirm cancel |
@@ -2563,7 +2563,7 @@ discard block |
||
| 2563 | 2563 | $nbMandated = 0; |
| 2564 | 2564 | foreach ($object->lines as $line) { |
| 2565 | 2565 | $res = $line->fetch_product(); |
| 2566 | - if ($res > 0) { |
|
| 2566 | + if ($res > 0) { |
|
| 2567 | 2567 | if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) { |
| 2568 | 2568 | $nbMandated++; |
| 2569 | 2569 | break; |
@@ -2604,7 +2604,7 @@ discard block |
||
| 2604 | 2604 | $morehtmlref = '<div class="refidno">'; |
| 2605 | 2605 | // Ref customer |
| 2606 | 2606 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1); |
| 2607 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 2607 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 2608 | 2608 | // Thirdparty |
| 2609 | 2609 | $morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer'); |
| 2610 | 2610 | if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $soc->id > 0) { |
@@ -2946,50 +2946,50 @@ discard block |
||
| 2946 | 2946 | include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php'; |
| 2947 | 2947 | |
| 2948 | 2948 | print '<tr>'; |
| 2949 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
| 2950 | - print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 2949 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
| 2950 | + print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 2951 | 2951 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 2952 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 2952 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 2953 | 2953 | } |
| 2954 | 2954 | print '</tr>'; |
| 2955 | 2955 | |
| 2956 | 2956 | print '<tr>'; |
| 2957 | - print '<td>' . $langs->trans('AmountVAT') . '</td>'; |
|
| 2958 | - print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 2957 | + print '<td>'.$langs->trans('AmountVAT').'</td>'; |
|
| 2958 | + print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 2959 | 2959 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 2960 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 2960 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 2961 | 2961 | } |
| 2962 | 2962 | print '</tr>'; |
| 2963 | 2963 | |
| 2964 | 2964 | if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { |
| 2965 | 2965 | print '<tr>'; |
| 2966 | - print '<td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
| 2967 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 2966 | + print '<td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
| 2967 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 2968 | 2968 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 2969 | 2969 | $object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); |
| 2970 | 2970 | |
| 2971 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 2971 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 2972 | 2972 | } |
| 2973 | 2973 | print '</tr>'; |
| 2974 | 2974 | } |
| 2975 | 2975 | |
| 2976 | 2976 | if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { |
| 2977 | 2977 | print '<tr>'; |
| 2978 | - print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
| 2979 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 2978 | + print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
| 2979 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 2980 | 2980 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 2981 | 2981 | $object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); |
| 2982 | 2982 | |
| 2983 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 2983 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 2984 | 2984 | } |
| 2985 | 2985 | print '</tr>'; |
| 2986 | 2986 | } |
| 2987 | 2987 | |
| 2988 | 2988 | print '<tr>'; |
| 2989 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
| 2990 | - print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 2989 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
| 2990 | + print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 2991 | 2991 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 2992 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 2992 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 2993 | 2993 | } |
| 2994 | 2994 | print '</tr>'; |
| 2995 | 2995 | |
@@ -3132,7 +3132,7 @@ discard block |
||
| 3132 | 3132 | 'enabled' => (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED), |
| 3133 | 3133 | 'perm' => $usercancreateorder, |
| 3134 | 3134 | 'label' => 'AddOrder', |
| 3135 | - 'url' => '/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid) |
|
| 3135 | + 'url' => '/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid) |
|
| 3136 | 3136 | ); |
| 3137 | 3137 | /*if (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED) { |
| 3138 | 3138 | if ($usercancreateorder) { |
@@ -3147,7 +3147,7 @@ discard block |
||
| 3147 | 3147 | 'enabled' => ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")), |
| 3148 | 3148 | 'perm' => $usercancreatepurchaseorder, |
| 3149 | 3149 | 'label' => 'AddPurchaseOrder', |
| 3150 | - 'url' => '/fourn/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid) |
|
| 3150 | + 'url' => '/fourn/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid) |
|
| 3151 | 3151 | ); |
| 3152 | 3152 | /*if ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")) { |
| 3153 | 3153 | if ($usercancreatepurchaseorder) { |
@@ -3162,7 +3162,7 @@ discard block |
||
| 3162 | 3162 | 'enabled' => (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED), |
| 3163 | 3163 | 'perm' => $usercancreateintervention, |
| 3164 | 3164 | 'label' => 'AddIntervention', |
| 3165 | - 'url' => '/fichinter/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid) |
|
| 3165 | + 'url' => '/fichinter/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid) |
|
| 3166 | 3166 | ); |
| 3167 | 3167 | /*if (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED) { |
| 3168 | 3168 | if ($usercancreateintervention) { |
@@ -3177,7 +3177,7 @@ discard block |
||
| 3177 | 3177 | 'enabled' => (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED), |
| 3178 | 3178 | 'perm' => $usercancreatecontract, |
| 3179 | 3179 | 'label' => 'AddContract', |
| 3180 | - 'url' => '/contrat/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid) |
|
| 3180 | + 'url' => '/contrat/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid) |
|
| 3181 | 3181 | ); |
| 3182 | 3182 | /*if (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED) { |
| 3183 | 3183 | $langs->load("contracts"); |
@@ -3203,7 +3203,7 @@ discard block |
||
| 3203 | 3203 | |
| 3204 | 3204 | $actionButtonsParameters = [ |
| 3205 | 3205 | "areDropdownButtons" => !getDolGlobalInt("MAIN_REMOVE_DROPDOWN_CREATE_BUTTONS_ON_ORDER"), |
| 3206 | - "backtopage" => $_SERVER["PHP_SELF"] . "?id=" . ((int) $id) |
|
| 3206 | + "backtopage" => $_SERVER["PHP_SELF"]."?id=".((int) $id) |
|
| 3207 | 3207 | ]; |
| 3208 | 3208 | |
| 3209 | 3209 | if ($numlines > 0) { |
@@ -3237,8 +3237,8 @@ discard block |
||
| 3237 | 3237 | } else { |
| 3238 | 3238 | // Set not signed (close) |
| 3239 | 3239 | if ($object->status == Propal::STATUS_DRAFT && $usercanclose) { |
| 3240 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&token='.newToken().'&action=closeas&token='.newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"'; |
|
| 3241 | - print '>' . $langs->trans('SetRefusedAndClose') . '</a>'; |
|
| 3240 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&token='.newToken().'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"'; |
|
| 3241 | + print '>'.$langs->trans('SetRefusedAndClose').'</a>'; |
|
| 3242 | 3242 | } |
| 3243 | 3243 | } |
| 3244 | 3244 | |
@@ -89,18 +89,18 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | $id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('orderid')); |
| 92 | -$ref = GETPOST('ref', 'alpha'); |
|
| 93 | -$socid = GETPOSTINT('socid'); |
|
| 94 | -$action = GETPOST('action', 'aZ09'); |
|
| 95 | -$cancel = GETPOST('cancel', 'alpha'); |
|
| 96 | -$confirm = GETPOST('confirm', 'alpha'); |
|
| 92 | +$ref = GETPOST('ref', 'alpha'); |
|
| 93 | +$socid = GETPOSTINT('socid'); |
|
| 94 | +$action = GETPOST('action', 'aZ09'); |
|
| 95 | +$cancel = GETPOST('cancel', 'alpha'); |
|
| 96 | +$confirm = GETPOST('confirm', 'alpha'); |
|
| 97 | 97 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 98 | 98 | |
| 99 | -$lineid = GETPOSTINT('lineid'); |
|
| 100 | -$contactid = GETPOSTINT('contactid'); |
|
| 101 | -$projectid = GETPOSTINT('projectid'); |
|
| 102 | -$origin = GETPOST('origin', 'alpha'); |
|
| 103 | -$originid = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility |
|
| 99 | +$lineid = GETPOSTINT('lineid'); |
|
| 100 | +$contactid = GETPOSTINT('contactid'); |
|
| 101 | +$projectid = GETPOSTINT('projectid'); |
|
| 102 | +$origin = GETPOST('origin', 'alpha'); |
|
| 103 | +$originid = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility |
|
| 104 | 104 | $rank = (GETPOSTINT('rank') > 0) ? GETPOSTINT('rank') : -1; |
| 105 | 105 | |
| 106 | 106 | |
@@ -140,26 +140,26 @@ discard block |
||
| 140 | 140 | $extrafields->fetch_name_optionals_label($object->table_element); |
| 141 | 141 | |
| 142 | 142 | // Load object |
| 143 | -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' |
|
| 143 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' |
|
| 144 | 144 | |
| 145 | 145 | // Permissions / Rights |
| 146 | -$usercanread = $user->hasRight("commande", "lire"); |
|
| 147 | -$usercancreate = $user->hasRight("commande", "creer"); |
|
| 148 | -$usercandelete = $user->hasRight("commande", "supprimer"); |
|
| 146 | +$usercanread = $user->hasRight("commande", "lire"); |
|
| 147 | +$usercancreate = $user->hasRight("commande", "creer"); |
|
| 148 | +$usercandelete = $user->hasRight("commande", "supprimer"); |
|
| 149 | 149 | |
| 150 | 150 | // Advanced permissions |
| 151 | -$usercanclose = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'close'))); |
|
| 152 | -$usercanvalidate = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'validate'))); |
|
| 153 | -$usercancancel = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'annuler'))); |
|
| 154 | -$usercansend = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'send')); |
|
| 155 | -$usercangeneretedoc = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'generetedoc')); |
|
| 151 | +$usercanclose = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'close'))); |
|
| 152 | +$usercanvalidate = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'validate'))); |
|
| 153 | +$usercancancel = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'annuler'))); |
|
| 154 | +$usercansend = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'send')); |
|
| 155 | +$usercangeneretedoc = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'generetedoc')); |
|
| 156 | 156 | |
| 157 | 157 | $usermustrespectpricemin = ((getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('produit', 'ignore_price_min_advance')) || !getDolGlobalString('MAIN_USE_ADVANCED_PERMS')); |
| 158 | 158 | $usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer')); |
| 159 | 159 | |
| 160 | -$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php |
|
| 161 | -$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php |
|
| 162 | -$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
| 160 | +$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php |
|
| 161 | +$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php |
|
| 162 | +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
| 163 | 163 | |
| 164 | 164 | |
| 165 | 165 | $error = 0; |
@@ -206,11 +206,11 @@ discard block |
||
| 206 | 206 | $action = ''; |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' |
|
| 209 | + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' |
|
| 210 | 210 | |
| 211 | - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
| 211 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
| 212 | 212 | |
| 213 | - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
| 213 | + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
| 214 | 214 | |
| 215 | 215 | // Action clone object |
| 216 | 216 | if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) { |
@@ -731,7 +731,7 @@ discard block |
||
| 731 | 731 | $pu_ht = ''; |
| 732 | 732 | $pu_ttc = ''; |
| 733 | 733 | $pu_ht_devise = ''; |
| 734 | - $pu_ttc_devise = ''; |
|
| 734 | + $pu_ttc_devise = ''; |
|
| 735 | 735 | |
| 736 | 736 | if (GETPOST('price_ht') !== '') { |
| 737 | 737 | $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); |
@@ -864,8 +864,8 @@ discard block |
||
| 864 | 864 | $pricebycustomerexist = true; |
| 865 | 865 | $pu_ht = price($prodcustprice->lines[0]->price); |
| 866 | 866 | $pu_ttc = price($prodcustprice->lines[0]->price_ttc); |
| 867 | - $price_min = price($prodcustprice->lines[0]->price_min); |
|
| 868 | - $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
| 867 | + $price_min = price($prodcustprice->lines[0]->price_min); |
|
| 868 | + $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
| 869 | 869 | $price_base_type = $prodcustprice->lines[0]->price_base_type; |
| 870 | 870 | $tva_tx = $prodcustprice->lines[0]->tva_tx; |
| 871 | 871 | if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', (string) $tva_tx)) { |
@@ -924,8 +924,8 @@ discard block |
||
| 924 | 924 | if (count($prodcustprice->lines) > 0) { |
| 925 | 925 | $pu_ht = price($prodcustprice->lines[0]->price); |
| 926 | 926 | $pu_ttc = price($prodcustprice->lines[0]->price_ttc); |
| 927 | - $price_min = price($prodcustprice->lines[0]->price_min); |
|
| 928 | - $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
| 927 | + $price_min = price($prodcustprice->lines[0]->price_min); |
|
| 928 | + $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
| 929 | 929 | $price_base_type = $prodcustprice->lines[0]->price_base_type; |
| 930 | 930 | $tva_tx = $prodcustprice->lines[0]->tva_tx; |
| 931 | 931 | if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) { |
@@ -1457,7 +1457,7 @@ discard block |
||
| 1457 | 1457 | GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms) |
| 1458 | 1458 | && isModEnabled('invoice') && $user->hasRight('facture', 'creer') |
| 1459 | 1459 | ) { |
| 1460 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 1460 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 1461 | 1461 | |
| 1462 | 1462 | $date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear')); |
| 1463 | 1463 | $forceFields = array(); |
@@ -1470,7 +1470,7 @@ discard block |
||
| 1470 | 1470 | |
| 1471 | 1471 | if ($deposit) { |
| 1472 | 1472 | setEventMessage('DepositGenerated'); |
| 1473 | - $locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id; |
|
| 1473 | + $locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id; |
|
| 1474 | 1474 | } else { |
| 1475 | 1475 | $error++; |
| 1476 | 1476 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -1478,7 +1478,7 @@ discard block |
||
| 1478 | 1478 | } |
| 1479 | 1479 | |
| 1480 | 1480 | // Define output language |
| 1481 | - if (! $error) { |
|
| 1481 | + if (!$error) { |
|
| 1482 | 1482 | $db->commit(); |
| 1483 | 1483 | |
| 1484 | 1484 | if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) { |
@@ -1506,7 +1506,7 @@ discard block |
||
| 1506 | 1506 | } |
| 1507 | 1507 | |
| 1508 | 1508 | if ($locationTarget) { |
| 1509 | - header('Location: ' . $locationTarget); |
|
| 1509 | + header('Location: '.$locationTarget); |
|
| 1510 | 1510 | exit; |
| 1511 | 1511 | } |
| 1512 | 1512 | } else { |
@@ -1834,7 +1834,7 @@ discard block |
||
| 1834 | 1834 | |
| 1835 | 1835 | $classname = ucfirst($subelement); |
| 1836 | 1836 | $objectsrc = new $classname($db); |
| 1837 | - '@phan-var-force Commande|Propal|Contrat $objectsrc'; // Can possibly be other class but CommonObject is too general |
|
| 1837 | + '@phan-var-force Commande|Propal|Contrat $objectsrc'; // Can possibly be other class but CommonObject is too general |
|
| 1838 | 1838 | $objectsrc->fetch($originid); |
| 1839 | 1839 | if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) { |
| 1840 | 1840 | $objectsrc->fetch_lines(); |
@@ -1931,7 +1931,7 @@ discard block |
||
| 1931 | 1931 | print '<form name="crea_commande" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
| 1932 | 1932 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
| 1933 | 1933 | print '<input type="hidden" name="action" value="add">'; |
| 1934 | - print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 1934 | + print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 1935 | 1935 | print '<input type="hidden" name="remise_percent" value="'.$soc->remise_percent.'">'; |
| 1936 | 1936 | print '<input type="hidden" name="origin" value="'.$origin.'">'; |
| 1937 | 1937 | print '<input type="hidden" name="originid" value="'.$originid.'">'; |
@@ -2110,7 +2110,7 @@ discard block |
||
| 2110 | 2110 | // Other attributes |
| 2111 | 2111 | $parameters = array(); |
| 2112 | 2112 | if (!empty($origin) && !empty($originid) && is_object($objectsrc)) { |
| 2113 | - $parameters['objectsrc'] = $objectsrc; |
|
| 2113 | + $parameters['objectsrc'] = $objectsrc; |
|
| 2114 | 2114 | } |
| 2115 | 2115 | $parameters['socid'] = $socid; |
| 2116 | 2116 | |
@@ -2327,7 +2327,7 @@ discard block |
||
| 2327 | 2327 | $nbMandated = 0; |
| 2328 | 2328 | foreach ($object->lines as $line) { |
| 2329 | 2329 | $res = $line->fetch_product(); |
| 2330 | - if ($res > 0) { |
|
| 2330 | + if ($res > 0) { |
|
| 2331 | 2331 | if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) { |
| 2332 | 2332 | $nbMandated++; |
| 2333 | 2333 | break; |
@@ -2351,7 +2351,7 @@ discard block |
||
| 2351 | 2351 | $deposit_percent_from_payment_terms = (float) getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); |
| 2352 | 2352 | |
| 2353 | 2353 | if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) { |
| 2354 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 2354 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 2355 | 2355 | |
| 2356 | 2356 | $object->fetchObjectLinked(); |
| 2357 | 2357 | |
@@ -2564,7 +2564,7 @@ discard block |
||
| 2564 | 2564 | $morehtmlref = '<div class="refidno">'; |
| 2565 | 2565 | // Ref customer |
| 2566 | 2566 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1); |
| 2567 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 2567 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 2568 | 2568 | // Thirdparty |
| 2569 | 2569 | $morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer'); |
| 2570 | 2570 | if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) { |
@@ -2850,36 +2850,36 @@ discard block |
||
| 2850 | 2850 | |
| 2851 | 2851 | $alert = ''; |
| 2852 | 2852 | if (getDolGlobalString('ORDER_MANAGE_MIN_AMOUNT') && $object->total_ht < $object->thirdparty->order_min_amount) { |
| 2853 | - $alert = ' ' . img_warning($langs->trans('OrderMinAmount') . ': ' . price($object->thirdparty->order_min_amount)); |
|
| 2853 | + $alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount)); |
|
| 2854 | 2854 | } |
| 2855 | 2855 | |
| 2856 | 2856 | print '<tr>'; |
| 2857 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
| 2858 | - print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 2857 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
| 2858 | + print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 2859 | 2859 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 2860 | 2860 | // Multicurrency Amount HT |
| 2861 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 2861 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 2862 | 2862 | } |
| 2863 | 2863 | print '</tr>'; |
| 2864 | 2864 | |
| 2865 | 2865 | print '<tr>'; |
| 2866 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>'; |
|
| 2867 | - print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 2866 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>'; |
|
| 2867 | + print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 2868 | 2868 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 2869 | 2869 | // Multicurrency Amount VAT |
| 2870 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 2870 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 2871 | 2871 | } |
| 2872 | 2872 | print '</tr>'; |
| 2873 | 2873 | |
| 2874 | 2874 | // Amount Local Taxes |
| 2875 | 2875 | if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { |
| 2876 | 2876 | print '<tr>'; |
| 2877 | - print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
| 2878 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 2877 | + print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
| 2878 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 2879 | 2879 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 2880 | 2880 | $object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); |
| 2881 | 2881 | |
| 2882 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 2882 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 2883 | 2883 | } |
| 2884 | 2884 | print '</tr>'; |
| 2885 | 2885 | } |
@@ -2887,22 +2887,22 @@ discard block |
||
| 2887 | 2887 | // Amount Local Taxes |
| 2888 | 2888 | if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { |
| 2889 | 2889 | print '<tr>'; |
| 2890 | - print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
| 2891 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 2890 | + print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
| 2891 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 2892 | 2892 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 2893 | 2893 | $object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); |
| 2894 | 2894 | |
| 2895 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 2895 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 2896 | 2896 | } |
| 2897 | 2897 | print '</tr>'; |
| 2898 | 2898 | } |
| 2899 | 2899 | |
| 2900 | 2900 | print '<tr>'; |
| 2901 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
| 2902 | - print '<td class="valuefield nowrap right amountcard">' . price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency) . '</td>'; |
|
| 2901 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
| 2902 | + print '<td class="valuefield nowrap right amountcard">'.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</td>'; |
|
| 2903 | 2903 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 2904 | 2904 | // Multicurrency Amount TTC |
| 2905 | - print '<td class="valuefield nowrap right amountcard">' . price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 2905 | + print '<td class="valuefield nowrap right amountcard">'.price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 2906 | 2906 | } |
| 2907 | 2907 | print '</tr>'."\n"; |
| 2908 | 2908 | |
@@ -3019,7 +3019,7 @@ discard block |
||
| 3019 | 3019 | if ($usercansend) { |
| 3020 | 3020 | print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', ''); |
| 3021 | 3021 | } else { |
| 3022 | - print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF']. '#', '', false); |
|
| 3022 | + print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'].'#', '', false); |
|
| 3023 | 3023 | } |
| 3024 | 3024 | } |
| 3025 | 3025 | } |
@@ -3046,7 +3046,7 @@ discard block |
||
| 3046 | 3046 | 'enabled' => (isModEnabled("supplier_order") && $object->statut > Commande::STATUS_DRAFT), |
| 3047 | 3047 | 'perm' => $usercancreatepurchaseorder, |
| 3048 | 3048 | 'label' => 'AddPurchaseOrder', |
| 3049 | - 'url' => '/fourn/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) |
|
| 3049 | + 'url' => '/fourn/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id) |
|
| 3050 | 3050 | ); |
| 3051 | 3051 | } |
| 3052 | 3052 | |
@@ -3062,7 +3062,7 @@ discard block |
||
| 3062 | 3062 | 'enabled' => (isModEnabled("intervention") && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0), |
| 3063 | 3063 | 'perm' => ($user->hasRight('ficheinter', 'creer') == 1), |
| 3064 | 3064 | 'label' => 'AddIntervention', |
| 3065 | - 'url' => '/fichinter/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid, |
|
| 3065 | + 'url' => '/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, |
|
| 3066 | 3066 | ); |
| 3067 | 3067 | /*if (isModEnabled('ficheinter')) { |
| 3068 | 3068 | $langs->load("interventions"); |
@@ -3082,7 +3082,7 @@ discard block |
||
| 3082 | 3082 | 'enabled' => (isModEnabled("contract") && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)), |
| 3083 | 3083 | 'perm' => ($user->hasRight('contrat', 'creer') == 1), |
| 3084 | 3084 | 'label' => 'AddContract', |
| 3085 | - 'url' => '/contrat/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid, |
|
| 3085 | + 'url' => '/contrat/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, |
|
| 3086 | 3086 | ); |
| 3087 | 3087 | /*if (isModEnabled('contrat') && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) { |
| 3088 | 3088 | $langs->load("contracts"); |
@@ -3105,7 +3105,7 @@ discard block |
||
| 3105 | 3105 | 'enabled' => (isModEnabled("shipping") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))), |
| 3106 | 3106 | 'perm' => $user->hasRight('expedition', 'creer'), |
| 3107 | 3107 | 'label' => 'CreateShipment', |
| 3108 | - 'url' => '/expedition/shipment.php?id=' . $object->id |
|
| 3108 | + 'url' => '/expedition/shipment.php?id='.$object->id |
|
| 3109 | 3109 | ); |
| 3110 | 3110 | /* |
| 3111 | 3111 | if ($user->hasRight('expedition', 'creer')) { |
@@ -3115,7 +3115,7 @@ discard block |
||
| 3115 | 3115 | }*/ |
| 3116 | 3116 | } else { |
| 3117 | 3117 | $langs->load("errors"); |
| 3118 | - print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
| 3118 | + print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
| 3119 | 3119 | } |
| 3120 | 3120 | } |
| 3121 | 3121 | |
@@ -3125,7 +3125,7 @@ discard block |
||
| 3125 | 3125 | 'enabled' => (isModEnabled('invoice') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0), |
| 3126 | 3126 | 'perm' => ($user->hasRight('facture', 'creer') && !getDolGlobalInt('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')), |
| 3127 | 3127 | 'label' => 'CreateBill', |
| 3128 | - 'url' => '/compta/facture/card.php?action=create&token=' . newToken() . '&origin=' . urlencode($object->element) . '&originid=' . $object->id . '&socid=' . $object->socid |
|
| 3128 | + 'url' => '/compta/facture/card.php?action=create&token='.newToken().'&origin='.urlencode($object->element).'&originid='.$object->id.'&socid='.$object->socid |
|
| 3129 | 3129 | ); |
| 3130 | 3130 | /* |
| 3131 | 3131 | if (isModEnabled('facture') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) { |
@@ -3177,7 +3177,7 @@ discard block |
||
| 3177 | 3177 | if ($numshipping == 0) { |
| 3178 | 3178 | print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, ''); |
| 3179 | 3179 | } else { |
| 3180 | - print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
| 3180 | + print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
| 3181 | 3181 | } |
| 3182 | 3182 | } |
| 3183 | 3183 | } |
@@ -1280,14 +1280,14 @@ discard block |
||
| 1280 | 1280 | || preg_match('/'.$keyfilter3.'/', $fullpath) || preg_match('/'.$keyfilter4.'/', $fullpath)); |
| 1281 | 1281 | |
| 1282 | 1282 | if (($test && !$include) || (!$test && $include)) { |
| 1283 | - unset($this->cats[$key]); // @phpstan-ignore-line |
|
| 1283 | + unset($this->cats[$key]); // @phpstan-ignore-line |
|
| 1284 | 1284 | } |
| 1285 | 1285 | } |
| 1286 | 1286 | } |
| 1287 | 1287 | |
| 1288 | 1288 | dol_syslog(get_class($this)."::get_full_arbo dol_sort_array", LOG_DEBUG); |
| 1289 | 1289 | |
| 1290 | - $this->cats = dol_sort_array($this->cats, 'fulllabel', 'asc', 1, 0, 1); // Sort on full label like "Label 1 >> Sublabel a >> Subsublabel" |
|
| 1290 | + $this->cats = dol_sort_array($this->cats, 'fulllabel', 'asc', 1, 0, 1); // Sort on full label like "Label 1 >> Sublabel a >> Subsublabel" |
|
| 1291 | 1291 | |
| 1292 | 1292 | return $this->cats; |
| 1293 | 1293 | } |
@@ -1706,10 +1706,10 @@ discard block |
||
| 1706 | 1706 | */ |
| 1707 | 1707 | public function isAnyPhotoAvailable($sdir) |
| 1708 | 1708 | { |
| 1709 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
| 1710 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php'; |
|
| 1709 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
| 1710 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; |
|
| 1711 | 1711 | |
| 1712 | - $sdir .= '/' . get_exdir($this->id, 2, 0, 0, $this, 'category') . $this->id . "/photos/"; |
|
| 1712 | + $sdir .= '/'.get_exdir($this->id, 2, 0, 0, $this, 'category').$this->id."/photos/"; |
|
| 1713 | 1713 | |
| 1714 | 1714 | $dir_osencoded = dol_osencode($sdir); |
| 1715 | 1715 | if (file_exists($dir_osencoded)) { |
@@ -1719,7 +1719,7 @@ discard block |
||
| 1719 | 1719 | if (!utf8_check($file)) { |
| 1720 | 1720 | $file = mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1'); // To be sure data is stored in UTF8 in memory |
| 1721 | 1721 | } |
| 1722 | - if (dol_is_file($sdir . $file) && image_format_supported($file) >= 0) { |
|
| 1722 | + if (dol_is_file($sdir.$file) && image_format_supported($file) >= 0) { |
|
| 1723 | 1723 | return true; |
| 1724 | 1724 | } |
| 1725 | 1725 | } |
@@ -1842,7 +1842,7 @@ discard block |
||
| 1842 | 1842 | $result .= $linkend; |
| 1843 | 1843 | |
| 1844 | 1844 | global $action; |
| 1845 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
| 1845 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
| 1846 | 1846 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
| 1847 | 1847 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 1848 | 1848 | if ($reshook > 0) { |
@@ -1381,7 +1381,9 @@ |
||
| 1381 | 1381 | $i = 0; |
| 1382 | 1382 | foreach ($fichinters as $fichinter) { |
| 1383 | 1383 | $i++; |
| 1384 | - if ($i > $limit) break; |
|
| 1384 | + if ($i > $limit) { |
|
| 1385 | + break; |
|
| 1386 | + } |
|
| 1385 | 1387 | |
| 1386 | 1388 | print "\t".'<tr class="oddeven">'."\n"; |
| 1387 | 1389 | print '<td class="nowrap tdtop">'; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | if (getDolGlobalString('PROJECT_IMAGE_PUBLIC_NEWLEAD')) { |
| 144 | 144 | print '<div class="backimagepublicnewlead">'; |
| 145 | - print '<img id="idPROJECT_IMAGE_PUBLIC_NEWLEAD" src="' . getDolGlobalString('PROJECT_IMAGE_PUBLIC_NEWLEAD').'">'; |
|
| 145 | + print '<img id="idPROJECT_IMAGE_PUBLIC_NEWLEAD" src="'.getDolGlobalString('PROJECT_IMAGE_PUBLIC_NEWLEAD').'">'; |
|
| 146 | 146 | print '</div>'; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | } else { |
| 229 | 229 | // Create the prospect |
| 230 | 230 | if (GETPOST('societe', 'alpha')) { |
| 231 | - $thirdparty->name = GETPOST('societe', 'alpha'); |
|
| 231 | + $thirdparty->name = GETPOST('societe', 'alpha'); |
|
| 232 | 232 | $thirdparty->name_alias = dolGetFirstLastname(GETPOST('firstname', 'alpha'), GETPOST('lastname', 'alpha')); |
| 233 | 233 | } else { |
| 234 | 234 | $thirdparty->name = dolGetFirstLastname(GETPOST('firstname', 'alpha'), GETPOST('lastname', 'alpha')); |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | } |
| 560 | 560 | |
| 561 | 561 | // Other attributes |
| 562 | -$parameters['tpl_context'] = 'public'; // define template context to public |
|
| 562 | +$parameters['tpl_context'] = 'public'; // define template context to public |
|
| 563 | 563 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
| 564 | 564 | // Comments |
| 565 | 565 | print '<tr>'; |
@@ -205,20 +205,20 @@ discard block |
||
| 205 | 205 | $sql .= "datec, "; |
| 206 | 206 | $sql .= "fk_user_author "; |
| 207 | 207 | $sql .= ") VALUES ("; |
| 208 | - $sql .= getEntity('resource') . ", "; |
|
| 208 | + $sql .= getEntity('resource').", "; |
|
| 209 | 209 | foreach ($new_resource_values as $value) { |
| 210 | - $sql .= " " . (!empty($value) ? "'" . $this->db->escape($value) . "'" : 'NULL') . ","; |
|
| 210 | + $sql .= " ".(!empty($value) ? "'".$this->db->escape($value)."'" : 'NULL').","; |
|
| 211 | 211 | } |
| 212 | - $sql .= " '" . $this->db->idate($this->date_creation) . "',"; |
|
| 213 | - $sql .= " " . (!empty($user->id) ? ((int) $user->id) : "null"); |
|
| 212 | + $sql .= " '".$this->db->idate($this->date_creation)."',"; |
|
| 213 | + $sql .= " ".(!empty($user->id) ? ((int) $user->id) : "null"); |
|
| 214 | 214 | $sql .= ")"; |
| 215 | 215 | |
| 216 | 216 | // Database session |
| 217 | 217 | $this->db->begin(); |
| 218 | 218 | try { |
| 219 | - dol_syslog(get_class($this) . "::create", LOG_DEBUG); |
|
| 219 | + dol_syslog(get_class($this)."::create", LOG_DEBUG); |
|
| 220 | 220 | } catch (Exception $exception) { |
| 221 | - error_log('dol_syslog error: ' . $exception->getMessage()); |
|
| 221 | + error_log('dol_syslog error: '.$exception->getMessage()); |
|
| 222 | 222 | } |
| 223 | 223 | $resql = $this->db->query($sql); |
| 224 | 224 | if (!$resql) { |
@@ -245,9 +245,9 @@ discard block |
||
| 245 | 245 | if ($error) { |
| 246 | 246 | foreach ($this->errors as $errmsg) { |
| 247 | 247 | try { |
| 248 | - dol_syslog(get_class($this) . "::create " . $errmsg, LOG_ERR); |
|
| 248 | + dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); |
|
| 249 | 249 | } catch (Exception $exception) { |
| 250 | - error_log('dol_syslog error: ' . $exception->getMessage()); |
|
| 250 | + error_log('dol_syslog error: '.$exception->getMessage()); |
|
| 251 | 251 | } |
| 252 | 252 | $this->error .= ($this->error ? ', '.$errmsg : $errmsg); |
| 253 | 253 | } |
@@ -404,8 +404,8 @@ discard block |
||
| 404 | 404 | $sql .= " max_users=".(isset($this->max_users) ? (int) $this->max_users : "null").","; |
| 405 | 405 | $sql .= " url=".(isset($this->url) ? "'".$this->db->escape($this->url)."'" : "null").","; |
| 406 | 406 | $sql .= " fk_code_type_resource=".(isset($this->fk_code_type_resource) ? "'".$this->db->escape($this->fk_code_type_resource)."'" : "null").","; |
| 407 | - $sql .= " tms=" . ("'" . $this->db->idate($this->date_modification) . "',"); |
|
| 408 | - $sql .= " fk_user_modif=" . (!empty($user->id) ? ((int) $user->id) : "null"); |
|
| 407 | + $sql .= " tms=".("'".$this->db->idate($this->date_modification)."',"); |
|
| 408 | + $sql .= " fk_user_modif=".(!empty($user->id) ? ((int) $user->id) : "null"); |
|
| 409 | 409 | $sql .= " WHERE rowid=".((int) $this->id); |
| 410 | 410 | |
| 411 | 411 | $this->db->begin(); |
@@ -985,7 +985,7 @@ discard block |
||
| 985 | 985 | } |
| 986 | 986 | $result .= $linkend; |
| 987 | 987 | |
| 988 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
| 988 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
| 989 | 989 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
| 990 | 990 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 991 | 991 | if ($reshook > 0) { |
@@ -33,14 +33,14 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | // Load Dolibarr environment |
| 35 | 35 | require '../../main.inc.php'; |
| 36 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 37 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php'; |
|
| 38 | -require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 39 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 40 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 41 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
|
| 42 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 43 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php'; |
|
| 36 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 37 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; |
|
| 38 | +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 39 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 40 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 41 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; |
|
| 42 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 43 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php'; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * @var Conf $conf |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | -include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
|
| 179 | +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
|
| 180 | 180 | |
| 181 | 181 | // Purge search criteria |
| 182 | 182 | 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 |
@@ -358,10 +358,10 @@ discard block |
||
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) { |
| 361 | - $object->fetchTimeSpent(GETPOSTINT('lineid')); // load properties like $object->timespent_xxx |
|
| 361 | + $object->fetchTimeSpent(GETPOSTINT('lineid')); // load properties like $object->timespent_xxx |
|
| 362 | 362 | |
| 363 | 363 | if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
| 364 | - $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
|
| 364 | + $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
|
| 365 | 365 | |
| 366 | 366 | if ($result < 0) { |
| 367 | 367 | $langs->load("errors"); |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | if (count($tasksarray) > 0) { |
| 382 | 382 | $id = $tasksarray[0]->id; |
| 383 | 383 | } else { |
| 384 | - header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode)); |
|
| 384 | + header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); |
|
| 385 | 385 | exit; |
| 386 | 386 | } |
| 387 | 387 | } |
@@ -418,9 +418,9 @@ discard block |
||
| 418 | 418 | if (!($projectstatic->thirdparty->id > 0)) { |
| 419 | 419 | setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors'); |
| 420 | 420 | } else { |
| 421 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 422 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 423 | - include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 421 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 422 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 423 | + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 424 | 424 | |
| 425 | 425 | $tmpinvoice = new Facture($db); |
| 426 | 426 | $tmptimespent = new Task($db); |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | $arrayoftasks = array(); |
| 487 | 487 | foreach ($toselect as $key => $value) { |
| 488 | 488 | // Get userid, timepent |
| 489 | - $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
|
| 489 | + $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
|
| 490 | 490 | $arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
| 491 | 491 | $arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
| 492 | 492 | } |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | } |
| 560 | 560 | |
| 561 | 561 | // Add lines |
| 562 | - $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject); |
|
| 562 | + $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject); |
|
| 563 | 563 | if ($lineid < 0) { |
| 564 | 564 | $error++; |
| 565 | 565 | setEventMessages(null, $tmpinvoice->errors, 'errors'); |
@@ -592,16 +592,16 @@ discard block |
||
| 592 | 592 | |
| 593 | 593 | $arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration; |
| 594 | 594 | $arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm; |
| 595 | - $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref . ' - ' . $ftask->label . ' - ' . $username; |
|
| 595 | + $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username; |
|
| 596 | 596 | $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $object->timespent_note); |
| 597 | 597 | |
| 598 | 598 | if (!empty($withdetail)) { |
| 599 | 599 | if (!empty($object->timespent_withhour)) { |
| 600 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour)); |
|
| 600 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_datehour)); |
|
| 601 | 601 | } else { |
| 602 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_date)); |
|
| 602 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_date)); |
|
| 603 | 603 | } |
| 604 | - $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)); |
|
| 604 | + $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)); |
|
| 605 | 605 | } |
| 606 | 606 | $arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user; |
| 607 | 607 | $arrayoftasks[$object->timespent_id]['fk_product'] = $object->timespent_fk_product; |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | $arrayoftasks = array(); |
| 680 | 680 | foreach ($toselect as $key => $value) { |
| 681 | 681 | // Get userid, timepent |
| 682 | - $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object) |
|
| 682 | + $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object) |
|
| 683 | 683 | // $object->id is now the task id |
| 684 | 684 | $arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
| 685 | 685 | $arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
@@ -755,7 +755,7 @@ discard block |
||
| 755 | 755 | // Add lines |
| 756 | 756 | $date_start = ''; |
| 757 | 757 | $date_end = ''; |
| 758 | - $lineName = $ftask->ref . ' - ' . $ftask->label; |
|
| 758 | + $lineName = $ftask->ref.' - '.$ftask->label; |
|
| 759 | 759 | $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); |
| 760 | 760 | if ($lineid < 0) { |
| 761 | 761 | $error++; |
@@ -765,8 +765,8 @@ discard block |
||
| 765 | 765 | |
| 766 | 766 | if (!$error) { |
| 767 | 767 | // Update lineid into line of timespent |
| 768 | - $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'element_time SET invoice_line_id = ' . ((int) $lineid) . ', invoice_id = ' . ((int) $tmpinvoice->id); |
|
| 769 | - $sql .= ' WHERE rowid IN (' . $db->sanitize(implode(',', $toselect)) . ')'; |
|
| 768 | + $sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id); |
|
| 769 | + $sql .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $toselect)).')'; |
|
| 770 | 770 | $result = $db->query($sql); |
| 771 | 771 | if (!$result) { |
| 772 | 772 | $error++; |
@@ -802,12 +802,12 @@ discard block |
||
| 802 | 802 | if (!($projectstatic->thirdparty->id > 0)) { |
| 803 | 803 | setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors'); |
| 804 | 804 | } else { |
| 805 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 806 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 807 | - include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 805 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 806 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 807 | + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 808 | 808 | |
| 809 | 809 | |
| 810 | - require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php'; |
|
| 810 | + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; |
|
| 811 | 811 | $tmpinter = new Fichinter($db); |
| 812 | 812 | $tmptimespent = new Task($db); |
| 813 | 813 | $fuser = new User($db); |
@@ -819,7 +819,7 @@ discard block |
||
| 819 | 819 | $tmpinter->socid = $projectstatic->thirdparty->id; |
| 820 | 820 | $tmpinter->date = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); |
| 821 | 821 | $tmpinter->fk_project = $projectstatic->id; |
| 822 | - $tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : ''); |
|
| 822 | + $tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : ''); |
|
| 823 | 823 | |
| 824 | 824 | if ($interToUse) { |
| 825 | 825 | $tmpinter->fetch($interToUse); |
@@ -852,7 +852,7 @@ discard block |
||
| 852 | 852 | $qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); |
| 853 | 853 | |
| 854 | 854 | // Add lines |
| 855 | - $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), $value['date'], $value['timespent']); |
|
| 855 | + $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), $value['date'], $value['timespent']); |
|
| 856 | 856 | } |
| 857 | 857 | } |
| 858 | 858 | |
@@ -883,9 +883,9 @@ discard block |
||
| 883 | 883 | //$result = $projectstatic->fetch($object->fk_project); |
| 884 | 884 | $arrayofselected = is_array($toselect) ? $toselect : array(); |
| 885 | 885 | |
| 886 | -$title = $object->ref . ' - ' . $langs->trans("TimeSpent"); |
|
| 886 | +$title = $object->ref.' - '.$langs->trans("TimeSpent"); |
|
| 887 | 887 | if (!empty($withproject)) { |
| 888 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : ''); |
|
| 888 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
| 889 | 889 | } |
| 890 | 890 | $help_url = ''; |
| 891 | 891 | |
@@ -934,13 +934,13 @@ discard block |
||
| 934 | 934 | |
| 935 | 935 | $param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : ''); |
| 936 | 936 | if ($search_user) { |
| 937 | - $param .= '&search_user=' . ((int) $search_user); |
|
| 937 | + $param .= '&search_user='.((int) $search_user); |
|
| 938 | 938 | } |
| 939 | 939 | if ($search_month) { |
| 940 | - $param .= '&search_month=' . ((int) $search_month); |
|
| 940 | + $param .= '&search_month='.((int) $search_month); |
|
| 941 | 941 | } |
| 942 | 942 | if ($search_year) { |
| 943 | - $param .= '&search_year=' . ((int) $search_year); |
|
| 943 | + $param .= '&search_year='.((int) $search_year); |
|
| 944 | 944 | } |
| 945 | 945 | |
| 946 | 946 | // Project card |
@@ -952,14 +952,14 @@ discard block |
||
| 952 | 952 | $morehtmlref .= $projectstatic->title; |
| 953 | 953 | // Thirdparty |
| 954 | 954 | if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { |
| 955 | - $morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
| 955 | + $morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
| 956 | 956 | } |
| 957 | 957 | $morehtmlref .= '</div>'; |
| 958 | 958 | |
| 959 | 959 | // Define a complementary filter for search of next/prev ref. |
| 960 | 960 | if (!$user->hasRight('projet', 'all', 'lire')) { |
| 961 | 961 | $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); |
| 962 | - $projectstatic->next_prev_filter = "rowid:IN:(" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0') . ")"; |
|
| 962 | + $projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; |
|
| 963 | 963 | } |
| 964 | 964 | |
| 965 | 965 | dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); |
@@ -977,25 +977,25 @@ discard block |
||
| 977 | 977 | print '</td>'; |
| 978 | 978 | print '<td>'; |
| 979 | 979 | if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { |
| 980 | - print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> '; |
|
| 980 | + print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> '; |
|
| 981 | 981 | $htmltext = $langs->trans("ProjectFollowOpportunity"); |
| 982 | 982 | print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); |
| 983 | 983 | print '<br>'; |
| 984 | 984 | } |
| 985 | 985 | if (!getDolGlobalString('PROJECT_HIDE_TASKS')) { |
| 986 | - print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> '; |
|
| 986 | + print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> '; |
|
| 987 | 987 | $htmltext = $langs->trans("ProjectFollowTasks"); |
| 988 | 988 | print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); |
| 989 | 989 | print '<br>'; |
| 990 | 990 | } |
| 991 | 991 | if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) { |
| 992 | - 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"' : '')) . '"> '; |
|
| 992 | + 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"' : '')).'"> '; |
|
| 993 | 993 | $htmltext = $langs->trans("ProjectBillTimeDescription"); |
| 994 | 994 | print $form->textwithpicto($langs->trans("BillTime"), $htmltext); |
| 995 | 995 | print '<br>'; |
| 996 | 996 | } |
| 997 | 997 | if (isModEnabled('eventorganization')) { |
| 998 | - 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"' : '')) . '"> '; |
|
| 998 | + 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"' : '')).'"> '; |
|
| 999 | 999 | $htmltext = $langs->trans("EventOrganizationDescriptionLong"); |
| 1000 | 1000 | print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); |
| 1001 | 1001 | } |
@@ -1003,7 +1003,7 @@ discard block |
||
| 1003 | 1003 | } |
| 1004 | 1004 | |
| 1005 | 1005 | // Visibility |
| 1006 | - print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>'; |
|
| 1006 | + print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>'; |
|
| 1007 | 1007 | if ($projectstatic->public) { |
| 1008 | 1008 | print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"'); |
| 1009 | 1009 | print $langs->trans('SharedProject'); |
@@ -1014,14 +1014,14 @@ discard block |
||
| 1014 | 1014 | print '</td></tr>'; |
| 1015 | 1015 | |
| 1016 | 1016 | // Budget |
| 1017 | - print '<tr><td>' . $langs->trans("Budget") . '</td><td>'; |
|
| 1017 | + print '<tr><td>'.$langs->trans("Budget").'</td><td>'; |
|
| 1018 | 1018 | if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { |
| 1019 | - print '<span class="amount">' . price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency) . '</span>'; |
|
| 1019 | + print '<span class="amount">'.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>'; |
|
| 1020 | 1020 | } |
| 1021 | 1021 | print '</td></tr>'; |
| 1022 | 1022 | |
| 1023 | 1023 | // Date start - end project |
| 1024 | - print '<tr><td>' . $langs->trans("Dates") . '</td><td>'; |
|
| 1024 | + print '<tr><td>'.$langs->trans("Dates").'</td><td>'; |
|
| 1025 | 1025 | $start = dol_print_date($projectstatic->date_start, 'day'); |
| 1026 | 1026 | print($start ? $start : '?'); |
| 1027 | 1027 | $end = dol_print_date($projectstatic->date_end, 'day'); |
@@ -1036,7 +1036,7 @@ discard block |
||
| 1036 | 1036 | $cols = 2; |
| 1037 | 1037 | $savobject = $object; |
| 1038 | 1038 | $object = $projectstatic; |
| 1039 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
| 1039 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
| 1040 | 1040 | $object = $savobject; |
| 1041 | 1041 | |
| 1042 | 1042 | print '</table>'; |
@@ -1054,7 +1054,7 @@ discard block |
||
| 1054 | 1054 | |
| 1055 | 1055 | // Categories |
| 1056 | 1056 | if (isModEnabled('category')) { |
| 1057 | - print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>'; |
|
| 1057 | + print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>'; |
|
| 1058 | 1058 | print $form->showCategories($projectstatic->id, 'project', 1); |
| 1059 | 1059 | print "</td></tr>"; |
| 1060 | 1060 | } |
@@ -1083,12 +1083,12 @@ discard block |
||
| 1083 | 1083 | |
| 1084 | 1084 | if (!empty($projectidforalltimes)) { |
| 1085 | 1085 | // We are on tab 'Time Spent' of project |
| 1086 | - $backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : ''); |
|
| 1087 | - $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
| 1086 | + $backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : ''); |
|
| 1087 | + $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
| 1088 | 1088 | } else { |
| 1089 | 1089 | // We are on tab 'Time Spent' of task |
| 1090 | - $backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : ''); |
|
| 1091 | - $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . ($object->id > 0 ? '&id=' . $object->id : '&projectid=' . $projectstatic->id) . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
| 1090 | + $backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : ''); |
|
| 1091 | + $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
| 1092 | 1092 | } |
| 1093 | 1093 | } else { |
| 1094 | 1094 | $linktocreatetimeBtnStatus = -2; |
@@ -1133,19 +1133,19 @@ discard block |
||
| 1133 | 1133 | print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition'); |
| 1134 | 1134 | |
| 1135 | 1135 | if ($action == 'deleteline') { |
| 1136 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : ''); |
|
| 1136 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : ''); |
|
| 1137 | 1137 | print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
| 1138 | 1138 | } |
| 1139 | 1139 | |
| 1140 | 1140 | $param = ($withproject ? '&withproject=1' : ''); |
| 1141 | - $param .= ($param ? '&' : '') . 'id=' . $object->id; // ID of task |
|
| 1142 | - $linkback = $withproject ? '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . '">' . $langs->trans("BackToList") . '</a>' : ''; |
|
| 1141 | + $param .= ($param ? '&' : '').'id='.$object->id; // ID of task |
|
| 1142 | + $linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : ''; |
|
| 1143 | 1143 | |
| 1144 | 1144 | if (!GETPOST('withproject') || empty($projectstatic->id)) { |
| 1145 | 1145 | $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); |
| 1146 | - $object->next_prev_filter = "fk_projet:IN:(" . $db->sanitize($projectsListId) . ")"; |
|
| 1146 | + $object->next_prev_filter = "fk_projet:IN:(".$db->sanitize($projectsListId).")"; |
|
| 1147 | 1147 | } else { |
| 1148 | - $object->next_prev_filter = "fk_projet:=:" . ((int) $projectstatic->id); |
|
| 1148 | + $object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id); |
|
| 1149 | 1149 | } |
| 1150 | 1150 | |
| 1151 | 1151 | $morehtmlref = ''; |
@@ -1153,12 +1153,12 @@ discard block |
||
| 1153 | 1153 | // Project |
| 1154 | 1154 | if (empty($withproject)) { |
| 1155 | 1155 | $morehtmlref .= '<div class="refidno">'; |
| 1156 | - $morehtmlref .= $langs->trans("Project") . ': '; |
|
| 1156 | + $morehtmlref .= $langs->trans("Project").': '; |
|
| 1157 | 1157 | $morehtmlref .= $projectstatic->getNomUrl(1); |
| 1158 | 1158 | $morehtmlref .= '<br>'; |
| 1159 | 1159 | |
| 1160 | 1160 | // Third party |
| 1161 | - $morehtmlref .= $langs->trans("ThirdParty") . ': '; |
|
| 1161 | + $morehtmlref .= $langs->trans("ThirdParty").': '; |
|
| 1162 | 1162 | if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) { |
| 1163 | 1163 | $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); |
| 1164 | 1164 | } |
@@ -1174,7 +1174,7 @@ discard block |
||
| 1174 | 1174 | print '<table class="border centpercent tableforfield">'; |
| 1175 | 1175 | |
| 1176 | 1176 | // Task parent |
| 1177 | - print '<tr><td>' . $langs->trans("ChildOfTask") . '</td><td>'; |
|
| 1177 | + print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>'; |
|
| 1178 | 1178 | if ($object->fk_task_parent > 0) { |
| 1179 | 1179 | $tasktmp = new Task($db); |
| 1180 | 1180 | $tasktmp->fetch($object->fk_task_parent); |
@@ -1183,7 +1183,7 @@ discard block |
||
| 1183 | 1183 | print '</td></tr>'; |
| 1184 | 1184 | |
| 1185 | 1185 | // Date start - Date end task |
| 1186 | - print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>'; |
|
| 1186 | + print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>'; |
|
| 1187 | 1187 | $start = dol_print_date($object->date_start, 'dayhour'); |
| 1188 | 1188 | print($start ? $start : '?'); |
| 1189 | 1189 | $end = dol_print_date($object->date_end, 'dayhour'); |
@@ -1195,7 +1195,7 @@ discard block |
||
| 1195 | 1195 | print '</td></tr>'; |
| 1196 | 1196 | |
| 1197 | 1197 | // Planned workload |
| 1198 | - print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>'; |
|
| 1198 | + print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>'; |
|
| 1199 | 1199 | if ($object->planned_workload) { |
| 1200 | 1200 | print convertSecondToTime($object->planned_workload, 'allhourmin'); |
| 1201 | 1201 | } |
@@ -1210,21 +1210,21 @@ discard block |
||
| 1210 | 1210 | print '<table class="border tableforfield centpercent">'; |
| 1211 | 1211 | |
| 1212 | 1212 | // Progress declared |
| 1213 | - print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>'; |
|
| 1214 | - print $object->progress != '' ? $object->progress . ' %' : ''; |
|
| 1213 | + print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>'; |
|
| 1214 | + print $object->progress != '' ? $object->progress.' %' : ''; |
|
| 1215 | 1215 | print '</td></tr>'; |
| 1216 | 1216 | |
| 1217 | 1217 | // Progress calculated |
| 1218 | - print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>'; |
|
| 1218 | + print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>'; |
|
| 1219 | 1219 | if ($object->planned_workload) { |
| 1220 | 1220 | $tmparray = $object->getSummaryOfTimeSpent(); |
| 1221 | 1221 | if ($tmparray['total_duration'] > 0) { |
| 1222 | - print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %'; |
|
| 1222 | + print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %'; |
|
| 1223 | 1223 | } else { |
| 1224 | 1224 | print '0 %'; |
| 1225 | 1225 | } |
| 1226 | 1226 | } else { |
| 1227 | - print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>'; |
|
| 1227 | + print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>'; |
|
| 1228 | 1228 | } |
| 1229 | 1229 | print '</td>'; |
| 1230 | 1230 | |
@@ -1240,7 +1240,7 @@ discard block |
||
| 1240 | 1240 | print dol_get_fiche_end(); |
| 1241 | 1241 | } else { |
| 1242 | 1242 | if ($action == 'deleteline') { |
| 1243 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : ''); |
|
| 1243 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : ''); |
|
| 1244 | 1244 | print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
| 1245 | 1245 | } |
| 1246 | 1246 | } |
@@ -1254,7 +1254,7 @@ discard block |
||
| 1254 | 1254 | |
| 1255 | 1255 | if ($action == 'deleteline' && !empty($projectidforalltimes)) { |
| 1256 | 1256 | // We must use projectidprojectid if on list of timespent of project and id=taskid if on list of timespent of a task |
| 1257 | - $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); |
|
| 1257 | + $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); |
|
| 1258 | 1258 | $formconfirm = $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
| 1259 | 1259 | } |
| 1260 | 1260 | |
@@ -1273,10 +1273,10 @@ discard block |
||
| 1273 | 1273 | // Definition of fields for list |
| 1274 | 1274 | $arrayfields = array(); |
| 1275 | 1275 | $arrayfields['t.element_date'] = array('label' => $langs->trans("Date"), 'checked' => 1); |
| 1276 | - $arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1','checked' => 1); |
|
| 1276 | + $arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1', 'checked' => 1); |
|
| 1277 | 1277 | $arrayfields['s.name_alias'] = array('label' => $langs->trans("AliasNameShort"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1'); |
| 1278 | 1278 | if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task |
| 1279 | - if (! empty($allprojectforuser)) { |
|
| 1279 | + if (!empty($allprojectforuser)) { |
|
| 1280 | 1280 | $arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1]; |
| 1281 | 1281 | $arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1]; |
| 1282 | 1282 | } |
@@ -1292,83 +1292,83 @@ discard block |
||
| 1292 | 1292 | $arrayfields['value'] = array('label' => $langs->trans("Value"), 'checked' => 1, 'enabled' => isModEnabled("salaries")); |
| 1293 | 1293 | $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)); |
| 1294 | 1294 | // Extra fields |
| 1295 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
| 1295 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
| 1296 | 1296 | |
| 1297 | 1297 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
| 1298 | - '@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
| 1298 | + '@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
| 1299 | 1299 | |
| 1300 | 1300 | $param = ''; |
| 1301 | 1301 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
| 1302 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
| 1302 | + $param .= '&contextpage='.urlencode($contextpage); |
|
| 1303 | 1303 | } |
| 1304 | 1304 | if ($limit > 0 && $limit != $conf->liste_limit) { |
| 1305 | 1305 | $param .= '&limit='.((int) $limit); |
| 1306 | 1306 | } |
| 1307 | 1307 | if ($search_month > 0) { |
| 1308 | - $param .= '&search_month=' . urlencode((string) ($search_month)); |
|
| 1308 | + $param .= '&search_month='.urlencode((string) ($search_month)); |
|
| 1309 | 1309 | } |
| 1310 | 1310 | if ($search_year > 0) { |
| 1311 | - $param .= '&search_year=' . urlencode((string) ($search_year)); |
|
| 1311 | + $param .= '&search_year='.urlencode((string) ($search_year)); |
|
| 1312 | 1312 | } |
| 1313 | 1313 | if (!empty($search_user)) { // We keep param if -1 because default value is forced to user id if not set |
| 1314 | 1314 | $param .= '&search_user='.urlencode($search_user); |
| 1315 | 1315 | } |
| 1316 | 1316 | if ($search_task_ref != '') { |
| 1317 | - $param .= '&search_task_ref=' . urlencode($search_task_ref); |
|
| 1317 | + $param .= '&search_task_ref='.urlencode($search_task_ref); |
|
| 1318 | 1318 | } |
| 1319 | 1319 | if ($search_company != '') { |
| 1320 | - $param .= '&$search_company=' . urlencode($search_company); |
|
| 1320 | + $param .= '&$search_company='.urlencode($search_company); |
|
| 1321 | 1321 | } |
| 1322 | 1322 | if ($search_company_alias != '') { |
| 1323 | - $param .= '&$search_company_alias=' . urlencode($search_company_alias); |
|
| 1323 | + $param .= '&$search_company_alias='.urlencode($search_company_alias); |
|
| 1324 | 1324 | } |
| 1325 | 1325 | if ($search_project_ref != '') { |
| 1326 | - $param .= '&$search_project_ref=' . urlencode($search_project_ref); |
|
| 1326 | + $param .= '&$search_project_ref='.urlencode($search_project_ref); |
|
| 1327 | 1327 | } |
| 1328 | 1328 | if ($search_project_label != '') { |
| 1329 | - $param .= '&$search_project_label=' . urlencode($search_project_label); |
|
| 1329 | + $param .= '&$search_project_label='.urlencode($search_project_label); |
|
| 1330 | 1330 | } |
| 1331 | 1331 | if ($search_task_label != '') { |
| 1332 | - $param .= '&search_task_label=' . urlencode($search_task_label); |
|
| 1332 | + $param .= '&search_task_label='.urlencode($search_task_label); |
|
| 1333 | 1333 | } |
| 1334 | 1334 | if ($search_note != '') { |
| 1335 | - $param .= '&search_note=' . urlencode($search_note); |
|
| 1335 | + $param .= '&search_note='.urlencode($search_note); |
|
| 1336 | 1336 | } |
| 1337 | 1337 | if ($search_duration != '') { |
| 1338 | - $param .= '&search_field2=' . urlencode((string) ($search_duration)); |
|
| 1338 | + $param .= '&search_field2='.urlencode((string) ($search_duration)); |
|
| 1339 | 1339 | } |
| 1340 | 1340 | if ($optioncss != '') { |
| 1341 | - $param .= '&optioncss=' . urlencode($optioncss); |
|
| 1341 | + $param .= '&optioncss='.urlencode($optioncss); |
|
| 1342 | 1342 | } |
| 1343 | 1343 | if ($search_date_startday) { |
| 1344 | - $param .= '&search_date_startday=' . urlencode((string) ($search_date_startday)); |
|
| 1344 | + $param .= '&search_date_startday='.urlencode((string) ($search_date_startday)); |
|
| 1345 | 1345 | } |
| 1346 | 1346 | if ($search_date_startmonth) { |
| 1347 | - $param .= '&search_date_startmonth=' . urlencode((string) ($search_date_startmonth)); |
|
| 1347 | + $param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth)); |
|
| 1348 | 1348 | } |
| 1349 | 1349 | if ($search_date_startyear) { |
| 1350 | - $param .= '&search_date_startyear=' . urlencode((string) ($search_date_startyear)); |
|
| 1350 | + $param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear)); |
|
| 1351 | 1351 | } |
| 1352 | 1352 | if ($search_date_endday) { |
| 1353 | - $param .= '&search_date_endday=' . urlencode((string) ($search_date_endday)); |
|
| 1353 | + $param .= '&search_date_endday='.urlencode((string) ($search_date_endday)); |
|
| 1354 | 1354 | } |
| 1355 | 1355 | if ($search_date_endmonth) { |
| 1356 | - $param .= '&search_date_endmonth=' . urlencode((string) ($search_date_endmonth)); |
|
| 1356 | + $param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth)); |
|
| 1357 | 1357 | } |
| 1358 | 1358 | if ($search_date_endyear) { |
| 1359 | - $param .= '&search_date_endyear=' . urlencode((string) ($search_date_endyear)); |
|
| 1359 | + $param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear)); |
|
| 1360 | 1360 | } |
| 1361 | 1361 | if ($search_timespent_starthour) { |
| 1362 | - $param .= '&search_timespent_duration_starthour=' . urlencode((string) ($search_timespent_starthour)); |
|
| 1362 | + $param .= '&search_timespent_duration_starthour='.urlencode((string) ($search_timespent_starthour)); |
|
| 1363 | 1363 | } |
| 1364 | 1364 | if ($search_timespent_startmin) { |
| 1365 | - $param .= '&search_timespent_duration_startmin=' . urlencode((string) ($search_timespent_startmin)); |
|
| 1365 | + $param .= '&search_timespent_duration_startmin='.urlencode((string) ($search_timespent_startmin)); |
|
| 1366 | 1366 | } |
| 1367 | 1367 | if ($search_timespent_endhour) { |
| 1368 | - $param .= '&search_timespent_duration_endhour=' . urlencode((string) ($search_timespent_endhour)); |
|
| 1368 | + $param .= '&search_timespent_duration_endhour='.urlencode((string) ($search_timespent_endhour)); |
|
| 1369 | 1369 | } |
| 1370 | 1370 | if ($search_timespent_endmin) { |
| 1371 | - $param .= '&search_timespent_duration_endmin=' . urlencode((string) ($search_timespent_endmin)); |
|
| 1371 | + $param .= '&search_timespent_duration_endmin='.urlencode((string) ($search_timespent_endmin)); |
|
| 1372 | 1372 | } |
| 1373 | 1373 | |
| 1374 | 1374 | /* |
@@ -1376,24 +1376,24 @@ discard block |
||
| 1376 | 1376 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
| 1377 | 1377 | */ |
| 1378 | 1378 | if ($id) { |
| 1379 | - $param .= '&id=' . urlencode((string) ($id)); |
|
| 1379 | + $param .= '&id='.urlencode((string) ($id)); |
|
| 1380 | 1380 | } |
| 1381 | 1381 | if ($projectid) { |
| 1382 | - $param .= '&projectid=' . urlencode((string) ($projectid)); |
|
| 1382 | + $param .= '&projectid='.urlencode((string) ($projectid)); |
|
| 1383 | 1383 | } |
| 1384 | 1384 | if ($withproject) { |
| 1385 | - $param .= '&withproject=' . urlencode((string) ($withproject)); |
|
| 1385 | + $param .= '&withproject='.urlencode((string) ($withproject)); |
|
| 1386 | 1386 | } |
| 1387 | 1387 | // Add $param from hooks |
| 1388 | 1388 | $parameters = array('param' => &$param); |
| 1389 | 1389 | $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 1390 | 1390 | $param .= $hookmanager->resPrint; |
| 1391 | 1391 | |
| 1392 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
| 1392 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
| 1393 | 1393 | if ($optioncss != '') { |
| 1394 | - print '<input type="hidden" name="optioncss" value="' . $optioncss . '">'; |
|
| 1394 | + print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
|
| 1395 | 1395 | } |
| 1396 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 1396 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1397 | 1397 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
| 1398 | 1398 | if ($action == 'editline') { |
| 1399 | 1399 | print '<input type="hidden" name="action" value="updateline">'; |
@@ -1408,13 +1408,13 @@ discard block |
||
| 1408 | 1408 | } else { |
| 1409 | 1409 | print '<input type="hidden" name="action" value="list">'; |
| 1410 | 1410 | } |
| 1411 | - print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
| 1412 | - print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
| 1411 | + print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
| 1412 | + print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
| 1413 | 1413 | |
| 1414 | - print '<input type="hidden" name="id" value="' . $id . '">'; |
|
| 1415 | - print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">'; |
|
| 1416 | - print '<input type="hidden" name="withproject" value="' . $withproject . '">'; |
|
| 1417 | - print '<input type="hidden" name="tab" value="' . $tab . '">'; |
|
| 1414 | + print '<input type="hidden" name="id" value="'.$id.'">'; |
|
| 1415 | + print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">'; |
|
| 1416 | + print '<input type="hidden" name="withproject" value="'.$withproject.'">'; |
|
| 1417 | + print '<input type="hidden" name="tab" value="'.$tab.'">'; |
|
| 1418 | 1418 | print '<input type="hidden" name="page_y" value="">'; |
| 1419 | 1419 | |
| 1420 | 1420 | // Form to convert time spent into invoice |
@@ -1441,7 +1441,7 @@ discard block |
||
| 1441 | 1441 | 'onelineperperiod' => 'OneLinePerTimeSpentLine', |
| 1442 | 1442 | ); |
| 1443 | 1443 | print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1); |
| 1444 | - print "\n" . '<script type="text/javascript">'; |
|
| 1444 | + print "\n".'<script type="text/javascript">'; |
|
| 1445 | 1445 | print ' |
| 1446 | 1446 | $(document).ready(function () { |
| 1447 | 1447 | setDetailVisibility(); |
@@ -1458,8 +1458,8 @@ discard block |
||
| 1458 | 1458 | } |
| 1459 | 1459 | }); |
| 1460 | 1460 | '; |
| 1461 | - print '</script>' . "\n"; |
|
| 1462 | - print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>'; |
|
| 1461 | + print '</script>'."\n"; |
|
| 1462 | + print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>'; |
|
| 1463 | 1463 | print '</td>'; |
| 1464 | 1464 | print '</tr>'; |
| 1465 | 1465 | |
@@ -1509,14 +1509,14 @@ discard block |
||
| 1509 | 1509 | |
| 1510 | 1510 | print '<br>'; |
| 1511 | 1511 | print '<div class="center">'; |
| 1512 | - print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '"> '; |
|
| 1513 | - print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 1512 | + print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'"> '; |
|
| 1513 | + print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 1514 | 1514 | print '</div>'; |
| 1515 | 1515 | print '<br>'; |
| 1516 | 1516 | } else { |
| 1517 | - print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>'; |
|
| 1517 | + print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>'; |
|
| 1518 | 1518 | print '<div class="center">'; |
| 1519 | - print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 1519 | + print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 1520 | 1520 | print '</div>'; |
| 1521 | 1521 | $massaction = ''; |
| 1522 | 1522 | } |
@@ -1529,7 +1529,7 @@ discard block |
||
| 1529 | 1529 | print '<table class="noborder centpercent">'; |
| 1530 | 1530 | print '<tr>'; |
| 1531 | 1531 | print '<td class="titlefield">'; |
| 1532 | - print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse'); |
|
| 1532 | + print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse'); |
|
| 1533 | 1533 | print '</td>'; |
| 1534 | 1534 | print '<td>'; |
| 1535 | 1535 | $forminter = new FormIntervention($db); |
@@ -1539,14 +1539,14 @@ discard block |
||
| 1539 | 1539 | print '</table>'; |
| 1540 | 1540 | |
| 1541 | 1541 | print '<div class="center">'; |
| 1542 | - print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '"> '; |
|
| 1543 | - print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
| 1542 | + print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'"> '; |
|
| 1543 | + print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
| 1544 | 1544 | print '</div>'; |
| 1545 | 1545 | print '<br>'; |
| 1546 | 1546 | } else { |
| 1547 | - print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>'; |
|
| 1547 | + print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>'; |
|
| 1548 | 1548 | print '<div class="center">'; |
| 1549 | - print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
| 1549 | + print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
| 1550 | 1550 | print '</div>'; |
| 1551 | 1551 | $massaction = ''; |
| 1552 | 1552 | } |
@@ -1616,14 +1616,14 @@ discard block |
||
| 1616 | 1616 | $sql .= " AND t.fk_element =".((int) $object->id); |
| 1617 | 1617 | } elseif (!empty($projectidforalltimes)) { |
| 1618 | 1618 | // Limit on one project |
| 1619 | - $sql .= " AND pt.fk_projet IN (" . $db->sanitize($projectidforalltimes) . ")"; |
|
| 1619 | + $sql .= " AND pt.fk_projet IN (".$db->sanitize($projectidforalltimes).")"; |
|
| 1620 | 1620 | } elseif (!empty($allprojectforuser)) { |
| 1621 | 1621 | // Limit on on user |
| 1622 | 1622 | if (empty($search_user)) { |
| 1623 | 1623 | $search_user = $user->id; |
| 1624 | 1624 | } |
| 1625 | 1625 | if ($search_user > 0) { |
| 1626 | - $sql .= " AND t.fk_user = " . ((int) $search_user); |
|
| 1626 | + $sql .= " AND t.fk_user = ".((int) $search_user); |
|
| 1627 | 1627 | } |
| 1628 | 1628 | } |
| 1629 | 1629 | |
@@ -1676,13 +1676,13 @@ discard block |
||
| 1676 | 1676 | if ($search_timespent_starthour || $search_timespent_startmin) { |
| 1677 | 1677 | $timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds |
| 1678 | 1678 | $timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds |
| 1679 | - $sql .= " AND t.element_duration >= " . $timespent_duration_start; |
|
| 1679 | + $sql .= " AND t.element_duration >= ".$timespent_duration_start; |
|
| 1680 | 1680 | } |
| 1681 | 1681 | |
| 1682 | 1682 | if ($search_timespent_endhour || $search_timespent_endmin) { |
| 1683 | 1683 | $timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds |
| 1684 | 1684 | $timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds |
| 1685 | - $sql .= " AND t.element_duration <= " . $timespent_duration_end; |
|
| 1685 | + $sql .= " AND t.element_duration <= ".$timespent_duration_end; |
|
| 1686 | 1686 | } |
| 1687 | 1687 | } |
| 1688 | 1688 | |
@@ -1730,13 +1730,13 @@ discard block |
||
| 1730 | 1730 | |
| 1731 | 1731 | if ($num >= 0) { |
| 1732 | 1732 | if (!empty($projectidforalltimes)) { |
| 1733 | - print '<!-- List of time spent for project -->' . "\n"; |
|
| 1733 | + print '<!-- List of time spent for project -->'."\n"; |
|
| 1734 | 1734 | |
| 1735 | 1735 | $title = $langs->trans("ListTaskTimeUserProject"); |
| 1736 | 1736 | |
| 1737 | 1737 | print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1); |
| 1738 | 1738 | } else { |
| 1739 | - print '<!-- List of time spent -->' . "\n"; |
|
| 1739 | + print '<!-- List of time spent -->'."\n"; |
|
| 1740 | 1740 | |
| 1741 | 1741 | $title = $langs->trans("ListTaskTimeForTask"); |
| 1742 | 1742 | |
@@ -1758,26 +1758,26 @@ discard block |
||
| 1758 | 1758 | * Form to add a new line of time spent |
| 1759 | 1759 | */ |
| 1760 | 1760 | if ($action == 'createtime' && $user->hasRight('projet', 'time')) { |
| 1761 | - print '<!-- table to add time spent -->' . "\n"; |
|
| 1761 | + print '<!-- table to add time spent -->'."\n"; |
|
| 1762 | 1762 | if (!empty($id)) { |
| 1763 | - print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
| 1763 | + print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
| 1764 | 1764 | } |
| 1765 | 1765 | |
| 1766 | 1766 | 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 |
| 1767 | 1767 | print '<table class="noborder nohover centpercent">'; |
| 1768 | 1768 | |
| 1769 | 1769 | print '<tr class="liste_titre">'; |
| 1770 | - print '<td>' . $langs->trans("Date") . '</td>'; |
|
| 1770 | + print '<td>'.$langs->trans("Date").'</td>'; |
|
| 1771 | 1771 | if (!empty($allprojectforuser)) { |
| 1772 | - print '<td>' . $langs->trans("Project") . '</td>'; |
|
| 1772 | + print '<td>'.$langs->trans("Project").'</td>'; |
|
| 1773 | 1773 | } |
| 1774 | 1774 | if (empty($id)) { |
| 1775 | - print '<td>' . $langs->trans("Task") . '</td>'; |
|
| 1775 | + print '<td>'.$langs->trans("Task").'</td>'; |
|
| 1776 | 1776 | } |
| 1777 | - print '<td>' . $langs->trans("By") . '</td>'; |
|
| 1778 | - print '<td>' . $langs->trans("Note") . '</td>'; |
|
| 1779 | - print '<td>' . $langs->trans("NewTimeSpent") . '</td>'; |
|
| 1780 | - print '<td>' . $langs->trans("ProgressDeclared") . '</td>'; |
|
| 1777 | + print '<td>'.$langs->trans("By").'</td>'; |
|
| 1778 | + print '<td>'.$langs->trans("Note").'</td>'; |
|
| 1779 | + print '<td>'.$langs->trans("NewTimeSpent").'</td>'; |
|
| 1780 | + print '<td>'.$langs->trans("ProgressDeclared").'</td>'; |
|
| 1781 | 1781 | if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) { |
| 1782 | 1782 | print '<td></td>'; |
| 1783 | 1783 | |
@@ -1831,14 +1831,14 @@ discard block |
||
| 1831 | 1831 | print $form->select_dolusers((GETPOSTINT('userid') ? GETPOSTINT('userid') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200'); |
| 1832 | 1832 | } else { |
| 1833 | 1833 | if ($nboftasks) { |
| 1834 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 1834 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 1835 | 1835 | } |
| 1836 | 1836 | } |
| 1837 | 1837 | print '</td>'; |
| 1838 | 1838 | |
| 1839 | 1839 | // Note |
| 1840 | 1840 | print '<td>'; |
| 1841 | - print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>'; |
|
| 1841 | + print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>'; |
|
| 1842 | 1842 | print '</td>'; |
| 1843 | 1843 | |
| 1844 | 1844 | // Duration - Time spent |
@@ -1906,7 +1906,7 @@ discard block |
||
| 1906 | 1906 | $selectedfields .= (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
| 1907 | 1907 | |
| 1908 | 1908 | print '<div class="div-table-responsive">'; |
| 1909 | - print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
|
| 1909 | + print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; |
|
| 1910 | 1910 | |
| 1911 | 1911 | // Fields title search |
| 1912 | 1912 | // -------------------------------------------------------------------- |
@@ -1931,20 +1931,20 @@ discard block |
||
| 1931 | 1931 | } |
| 1932 | 1932 | // Thirdparty |
| 1933 | 1933 | if (!empty($arrayfields['p.fk_soc']['checked'])) { |
| 1934 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>'; |
|
| 1934 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>'; |
|
| 1935 | 1935 | } |
| 1936 | 1936 | |
| 1937 | 1937 | // Thirdparty alias |
| 1938 | 1938 | if (!empty($arrayfields['s.name_alias']['checked'])) { |
| 1939 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>'; |
|
| 1939 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>'; |
|
| 1940 | 1940 | } |
| 1941 | 1941 | |
| 1942 | 1942 | if (!empty($allprojectforuser)) { |
| 1943 | 1943 | if (!empty($arrayfields['p.project_ref']['checked'])) { |
| 1944 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>'; |
|
| 1944 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>'; |
|
| 1945 | 1945 | } |
| 1946 | 1946 | if (!empty($arrayfields['p.project_label']['checked'])) { |
| 1947 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>'; |
|
| 1947 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>'; |
|
| 1948 | 1948 | } |
| 1949 | 1949 | } |
| 1950 | 1950 | // Task |
@@ -1962,7 +1962,7 @@ discard block |
||
| 1962 | 1962 | } |
| 1963 | 1963 | // Note |
| 1964 | 1964 | if (!empty($arrayfields['t.note']['checked'])) { |
| 1965 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>'; |
|
| 1965 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>'; |
|
| 1966 | 1966 | } |
| 1967 | 1967 | // Duration |
| 1968 | 1968 | if (!empty($arrayfields['t.element_duration']['checked'])) { |
@@ -1973,7 +1973,7 @@ discard block |
||
| 1973 | 1973 | if ($search_timespent_starthour || $search_timespent_startmin) { |
| 1974 | 1974 | $durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60); |
| 1975 | 1975 | } |
| 1976 | - print '<div class="nowraponall">' . $langs->trans('from') . ' '; |
|
| 1976 | + print '<div class="nowraponall">'.$langs->trans('from').' '; |
|
| 1977 | 1977 | print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1); |
| 1978 | 1978 | print '</div>'; |
| 1979 | 1979 | |
@@ -1981,7 +1981,7 @@ discard block |
||
| 1981 | 1981 | if ($search_timespent_endhour || $search_timespent_endmin) { |
| 1982 | 1982 | $durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60); |
| 1983 | 1983 | } |
| 1984 | - print '<div class="nowraponall">' . $langs->trans('to') . ' '; |
|
| 1984 | + print '<div class="nowraponall">'.$langs->trans('to').' '; |
|
| 1985 | 1985 | print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1); |
| 1986 | 1986 | print '</div>'; |
| 1987 | 1987 | |
@@ -1997,7 +1997,7 @@ discard block |
||
| 1997 | 1997 | } |
| 1998 | 1998 | // Value billed |
| 1999 | 1999 | if (!empty($arrayfields['valuebilled']['checked'])) { |
| 2000 | - print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>'; |
|
| 2000 | + print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>'; |
|
| 2001 | 2001 | } |
| 2002 | 2002 | |
| 2003 | 2003 | /* |
@@ -2015,7 +2015,7 @@ discard block |
||
| 2015 | 2015 | print $searchpicto; |
| 2016 | 2016 | print '</td>'; |
| 2017 | 2017 | } |
| 2018 | - print '</tr>' . "\n"; |
|
| 2018 | + print '</tr>'."\n"; |
|
| 2019 | 2019 | |
| 2020 | 2020 | |
| 2021 | 2021 | $totalarray = array(); |
@@ -2130,7 +2130,7 @@ discard block |
||
| 2130 | 2130 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
| 2131 | 2131 | print '<td class="center nowraponall">'; |
| 2132 | 2132 | if (($action == 'editline' || $action == 'splitline') && GETPOSTINT('lineid') == $task_time->rowid) { |
| 2133 | - print '<input type="hidden" name="lineid" value="' . GETPOSTINT('lineid') . '">'; |
|
| 2133 | + print '<input type="hidden" name="lineid" value="'.GETPOSTINT('lineid').'">'; |
|
| 2134 | 2134 | print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">'; |
| 2135 | 2135 | print '<br>'; |
| 2136 | 2136 | print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
@@ -2141,7 +2141,7 @@ discard block |
||
| 2141 | 2141 | print '</a>'; |
| 2142 | 2142 | |
| 2143 | 2143 | if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) { |
| 2144 | - 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' : '') . '">'; |
|
| 2144 | + 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' : '').'">'; |
|
| 2145 | 2145 | print img_split('', 'class="pictofixedwidth paddingleft"'); |
| 2146 | 2146 | print '</a>'; |
| 2147 | 2147 | } |
@@ -2156,7 +2156,7 @@ discard block |
||
| 2156 | 2156 | $selected = 1; |
| 2157 | 2157 | } |
| 2158 | 2158 | print ' '; |
| 2159 | - print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
| 2159 | + print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
| 2160 | 2160 | } |
| 2161 | 2161 | } |
| 2162 | 2162 | } |
@@ -2275,7 +2275,7 @@ discard block |
||
| 2275 | 2275 | } |
| 2276 | 2276 | } |
| 2277 | 2277 | } elseif ($action !== 'createtime') { |
| 2278 | - print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
| 2278 | + print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
| 2279 | 2279 | } |
| 2280 | 2280 | |
| 2281 | 2281 | // Task label |
@@ -2304,9 +2304,9 @@ discard block |
||
| 2304 | 2304 | } |
| 2305 | 2305 | if (count($contactsoftask) > 0) { |
| 2306 | 2306 | print img_object('', 'user', 'class="pictofixedwidth hideonsmartphone"'); |
| 2307 | - 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 |
|
| 2307 | + 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 |
|
| 2308 | 2308 | } else { |
| 2309 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2309 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2310 | 2310 | } |
| 2311 | 2311 | } else { |
| 2312 | 2312 | $userstatic->id = $task_time->fk_user; |
@@ -2328,7 +2328,7 @@ discard block |
||
| 2328 | 2328 | if (!empty($arrayfields['t.note']['checked'])) { |
| 2329 | 2329 | if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) { |
| 2330 | 2330 | print '<td class="small">'; |
| 2331 | - print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
| 2331 | + print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
| 2332 | 2332 | print '</td>'; |
| 2333 | 2333 | } else { |
| 2334 | 2334 | print '<td class="small tdoverflowmax150 classfortooltip" title="'.dol_string_onlythesehtmltags(dol_htmlentitiesbr($task_time->note)).'">'; |
@@ -2339,7 +2339,7 @@ discard block |
||
| 2339 | 2339 | $totalarray['nbfield']++; |
| 2340 | 2340 | } |
| 2341 | 2341 | } elseif ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) { |
| 2342 | - print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
| 2342 | + print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
| 2343 | 2343 | } |
| 2344 | 2344 | |
| 2345 | 2345 | // Time spent |
@@ -2400,7 +2400,7 @@ discard block |
||
| 2400 | 2400 | $value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1); |
| 2401 | 2401 | |
| 2402 | 2402 | print '<td class="nowraponall right">'; |
| 2403 | - print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">'; |
|
| 2403 | + print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">'; |
|
| 2404 | 2404 | print price($value, 1, $langs, 1, -1, -1, $conf->currency); |
| 2405 | 2405 | print '</span>'; |
| 2406 | 2406 | print '</td>'; |
@@ -2457,7 +2457,7 @@ discard block |
||
| 2457 | 2457 | } |
| 2458 | 2458 | } |
| 2459 | 2459 | } else { |
| 2460 | - print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>'; |
|
| 2460 | + print '<span class="opacitymedium">'.$langs->trans("NA").'</span>'; |
|
| 2461 | 2461 | } |
| 2462 | 2462 | } |
| 2463 | 2463 | print '</td>'; |
@@ -2491,7 +2491,7 @@ discard block |
||
| 2491 | 2491 | print '</a>'; |
| 2492 | 2492 | |
| 2493 | 2493 | if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) { |
| 2494 | - 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' : '') . '">'; |
|
| 2494 | + 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' : '').'">'; |
|
| 2495 | 2495 | print img_split('', 'class="pictofixedwidth paddingleft"'); |
| 2496 | 2496 | print '</a>'; |
| 2497 | 2497 | } |
@@ -2508,12 +2508,12 @@ discard block |
||
| 2508 | 2508 | print ' '; |
| 2509 | 2509 | // Disable select if task not billable or already invoiced |
| 2510 | 2510 | $disabled = (intval($task_time->billable) != 1 || $invoiced); |
| 2511 | - $ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
| 2511 | + $ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
| 2512 | 2512 | if ($disabled) { |
| 2513 | 2513 | // If disabled, a dbl-click very close outside the control |
| 2514 | 2514 | // will re-enable it, so that user is not blocked if needed. |
| 2515 | - print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>'; |
|
| 2516 | - print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>'; |
|
| 2515 | + print '<span id="cbsp'.$task_time->rowid.'">'.$ctrl.'</span>'; |
|
| 2516 | + print '<script>$("#cbsp'.$task_time->rowid.'").dblclick(()=>{ $("#cb'.$task_time->rowid.'").removeAttr("disabled") })</script>'; |
|
| 2517 | 2517 | } else { |
| 2518 | 2518 | print $ctrl; |
| 2519 | 2519 | } |
@@ -2611,7 +2611,7 @@ discard block |
||
| 2611 | 2611 | print img_object('', 'user', 'class="hideonsmartphone"'); |
| 2612 | 2612 | print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask); |
| 2613 | 2613 | } else { |
| 2614 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2614 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2615 | 2615 | } |
| 2616 | 2616 | } else { |
| 2617 | 2617 | $userstatic->id = $task_time->fk_user; |
@@ -2628,13 +2628,13 @@ discard block |
||
| 2628 | 2628 | if (!empty($arrayfields['t.note']['checked'])) { |
| 2629 | 2629 | print '<td class="tdoverflowmax300">'; |
| 2630 | 2630 | if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
| 2631 | - print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
| 2631 | + print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
| 2632 | 2632 | } else { |
| 2633 | 2633 | print dol_nl2br($task_time->note); |
| 2634 | 2634 | } |
| 2635 | 2635 | print '</td>'; |
| 2636 | 2636 | } elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
| 2637 | - print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_1 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
| 2637 | + print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_1.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
| 2638 | 2638 | } |
| 2639 | 2639 | |
| 2640 | 2640 | // Time spent |
@@ -2775,7 +2775,7 @@ discard block |
||
| 2775 | 2775 | print img_object('', 'user', 'class="hideonsmartphone"'); |
| 2776 | 2776 | print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, '', 0, '', $contactsoftask); |
| 2777 | 2777 | } else { |
| 2778 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2778 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2779 | 2779 | } |
| 2780 | 2780 | } else { |
| 2781 | 2781 | $userstatic->id = $task_time->fk_user; |
@@ -2792,13 +2792,13 @@ discard block |
||
| 2792 | 2792 | if (!empty($arrayfields['t.note']['checked'])) { |
| 2793 | 2793 | print '<td class="small tdoverflowmax300"">'; |
| 2794 | 2794 | if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
| 2795 | - print '<textarea name="timespent_note_line_2" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
| 2795 | + print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
| 2796 | 2796 | } else { |
| 2797 | 2797 | print dol_nl2br($task_time->note); |
| 2798 | 2798 | } |
| 2799 | 2799 | print '</td>'; |
| 2800 | 2800 | } elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
| 2801 | - print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
| 2801 | + print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
| 2802 | 2802 | } |
| 2803 | 2803 | |
| 2804 | 2804 | // Time spent |
@@ -2872,14 +2872,14 @@ discard block |
||
| 2872 | 2872 | $i++; |
| 2873 | 2873 | if ($i == 1) { |
| 2874 | 2874 | if ($num < $limit && empty($offset)) { |
| 2875 | - print '<td class="left">' . $langs->trans("Total") . '</td>'; |
|
| 2875 | + print '<td class="left">'.$langs->trans("Total").'</td>'; |
|
| 2876 | 2876 | } else { |
| 2877 | 2877 | print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>'; |
| 2878 | 2878 | } |
| 2879 | 2879 | } elseif (isset($totalarray['totaldurationfield']) && $totalarray['totaldurationfield'] == $i) { |
| 2880 | - print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>'; |
|
| 2880 | + print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>'; |
|
| 2881 | 2881 | } elseif (isset($totalarray['totalvaluefield']) && $totalarray['totalvaluefield'] == $i) { |
| 2882 | - print '<td class="right">' . price($totalarray['totalvalue']) . '</td>'; |
|
| 2882 | + print '<td class="right">'.price($totalarray['totalvalue']).'</td>'; |
|
| 2883 | 2883 | //} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>'; |
| 2884 | 2884 | } else { |
| 2885 | 2885 | print '<td></td>'; |
@@ -2895,8 +2895,8 @@ discard block |
||
| 2895 | 2895 | $totalnboffields++; |
| 2896 | 2896 | } |
| 2897 | 2897 | } |
| 2898 | - print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">'; |
|
| 2899 | - print '<span class="opacitymedium">' . $langs->trans("None") . '</span>'; |
|
| 2898 | + print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">'; |
|
| 2899 | + print '<span class="opacitymedium">'.$langs->trans("None").'</span>'; |
|
| 2900 | 2900 | print '</td></tr>'; |
| 2901 | 2901 | } |
| 2902 | 2902 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $offsetunit = GETPOST('offsetunittype_duration', 'aZ09'); |
| 83 | 83 | $remindertype = GETPOST('selectremindertype', 'aZ09'); |
| 84 | 84 | $modelmail = GETPOSTINT('actioncommsendmodel_mail'); |
| 85 | -$complete = GETPOST('complete', 'alpha'); // 'na' must be allowed |
|
| 85 | +$complete = GETPOST('complete', 'alpha'); // 'na' must be allowed |
|
| 86 | 86 | $private = GETPOST('private', 'alphanohtml'); |
| 87 | 87 | if ($complete == 'na' || $complete == -2) { |
| 88 | 88 | $complete = -1; |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | if (GETPOSTISSET("contactid")) { |
| 458 | 458 | $object->contact_id = GETPOSTINT("contactid"); |
| 459 | 459 | |
| 460 | - $object->contact = $contact; // For backward compatibility |
|
| 460 | + $object->contact = $contact; // For backward compatibility |
|
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | if (GETPOSTINT('socid') > 0) { |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | if (is_array($listofresourceid) && count($listofresourceid)) { |
| 552 | 552 | foreach ($listofresourceid as $resource_id => $val) { |
| 553 | 553 | $resource_type = 'dolresource'; |
| 554 | - $busy = 1;//GETPOSTINT('busy'); |
|
| 554 | + $busy = 1; //GETPOSTINT('busy'); |
|
| 555 | 555 | |
| 556 | 556 | // Resources association |
| 557 | 557 | if (getDolGlobalString('RESOURCE_USED_IN_EVENT_CHECK')) { |
@@ -567,24 +567,24 @@ discard block |
||
| 567 | 567 | } |
| 568 | 568 | |
| 569 | 569 | $sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label"; |
| 570 | - $sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er"; |
|
| 571 | - $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = '" . $db->escape($resource_type) . "'"; |
|
| 572 | - $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'"; |
|
| 573 | - $sql .= " WHERE er.resource_id = " . ((int) $resource_id); |
|
| 570 | + $sql .= " FROM ".MAIN_DB_PREFIX."element_resources as er"; |
|
| 571 | + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."resource as r ON r.rowid = er.resource_id AND er.resource_type = '".$db->escape($resource_type)."'"; |
|
| 572 | + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm as ac ON ac.id = er.element_id AND er.element_type = '".$db->escape($object->element)."'"; |
|
| 573 | + $sql .= " WHERE er.resource_id = ".((int) $resource_id); |
|
| 574 | 574 | $sql .= " AND er.busy = 1"; |
| 575 | 575 | $sql .= " AND ("; |
| 576 | 576 | |
| 577 | 577 | // event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end) |
| 578 | - $sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))"; |
|
| 578 | + $sql .= " (ac.datep <= '".$db->idate($eventDateStart)."' AND (ac.datep2 IS NULL OR ac.datep2 >= '".$db->idate($eventDateStart)."'))"; |
|
| 579 | 579 | // event date end between ac.datep and ac.datep2 |
| 580 | 580 | if (!empty($eventDateEnd)) { |
| 581 | - $sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))"; |
|
| 581 | + $sql .= " OR (ac.datep <= '".$db->idate($eventDateEnd)."' AND (ac.datep2 >= '".$db->idate($eventDateEnd)."'))"; |
|
| 582 | 582 | } |
| 583 | 583 | // event date start before ac.datep and event date end after ac.datep2 |
| 584 | 584 | $sql .= " OR ("; |
| 585 | - $sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'"; |
|
| 585 | + $sql .= "ac.datep >= '".$db->idate($eventDateStart)."'"; |
|
| 586 | 586 | if (!empty($eventDateEnd)) { |
| 587 | - $sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')"; |
|
| 587 | + $sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '".$db->idate($eventDateEnd)."')"; |
|
| 588 | 588 | } |
| 589 | 589 | $sql .= ")"; |
| 590 | 590 | |
@@ -598,9 +598,9 @@ discard block |
||
| 598 | 598 | if ($db->num_rows($resql) > 0) { |
| 599 | 599 | // Resource already in use |
| 600 | 600 | $error++; |
| 601 | - $object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; |
|
| 601 | + $object->error = $langs->trans('ErrorResourcesAlreadyInUse').' : '; |
|
| 602 | 602 | while ($obj = $db->fetch_object($resql)) { |
| 603 | - $object->error .= '<br> - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); |
|
| 603 | + $object->error .= '<br> - '.$langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label.' ['.$obj->ac_id.']'); |
|
| 604 | 604 | } |
| 605 | 605 | $object->errors[] = $object->error; |
| 606 | 606 | } |
@@ -705,12 +705,12 @@ discard block |
||
| 705 | 705 | if ($selectedrecurrulefreq == 'WEEKLY' && !empty($selectedrecurrulebyday)) { |
| 706 | 706 | $firstdatearray = dol_get_first_day_week(GETPOSTINT("apday"), GETPOSTINT("apmonth"), GETPOSTINT("apyear")); |
| 707 | 707 | $datep = dol_mktime($fulldayevent ? 0 : GETPOSTINT("aphour"), $fulldayevent ? 0 : GETPOSTINT("apmin"), $fulldayevent ? 0 : GETPOSTINT("apsec"), $firstdatearray['month'], $firstdatearray['first_day'], $firstdatearray['year'], $tzforfullday ? $tzforfullday : 'tzuserrel'); |
| 708 | - $datep = dol_time_plus_duree($datep, $selectedrecurrulebyday + 6, 'd');//We begin the week after |
|
| 708 | + $datep = dol_time_plus_duree($datep, $selectedrecurrulebyday + 6, 'd'); //We begin the week after |
|
| 709 | 709 | $dayoffset = 7; |
| 710 | 710 | $monthoffset = 0; |
| 711 | 711 | } elseif ($selectedrecurrulefreq == 'MONTHLY' && !empty($selectedrecurrulebymonthday)) { |
| 712 | 712 | $firstday = $selectedrecurrulebymonthday; |
| 713 | - $firstmonth = GETPOST("apday") > $selectedrecurrulebymonthday ? GETPOSTINT("apmonth") + 1 : GETPOSTINT("apmonth");//We begin the week after |
|
| 713 | + $firstmonth = GETPOST("apday") > $selectedrecurrulebymonthday ? GETPOSTINT("apmonth") + 1 : GETPOSTINT("apmonth"); //We begin the week after |
|
| 714 | 714 | $datep = dol_mktime($fulldayevent ? 0 : GETPOSTINT("aphour"), $fulldayevent ? 0 : GETPOSTINT("apmin"), $fulldayevent ? 0 : GETPOSTINT("apsec"), $firstmonth, $firstday, GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel'); |
| 715 | 715 | $dayoffset = 0; |
| 716 | 716 | $monthoffset = 1; |
@@ -815,9 +815,9 @@ discard block |
||
| 815 | 815 | |
| 816 | 816 | // increment date for recurrent events |
| 817 | 817 | $datep = dol_time_plus_duree($datep, $dayoffset, 'd'); |
| 818 | - $datep = dol_time_plus_duree($datep, $monthoffset, 'm'); // @phan-suppress-current-line PhanPluginSuspiciousParamOrder |
|
| 818 | + $datep = dol_time_plus_duree($datep, $monthoffset, 'm'); // @phan-suppress-current-line PhanPluginSuspiciousParamOrder |
|
| 819 | 819 | $datef = dol_time_plus_duree($datef, $dayoffset, 'd'); |
| 820 | - $datef = dol_time_plus_duree($datef, $monthoffset, 'm'); // @phan-suppress-current-line PhanPluginSuspiciousParamOrder |
|
| 820 | + $datef = dol_time_plus_duree($datef, $monthoffset, 'm'); // @phan-suppress-current-line PhanPluginSuspiciousParamOrder |
|
| 821 | 821 | } |
| 822 | 822 | } |
| 823 | 823 | if (!empty($backtopage) && !$error) { |
@@ -1160,7 +1160,7 @@ discard block |
||
| 1160 | 1160 | if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') { |
| 1161 | 1161 | $error = 0; |
| 1162 | 1162 | |
| 1163 | - $shour = (int) dol_print_date($object->datep, "%H", 'tzuserrel'); // We take the date visible by user $newdate is also date visible by user. |
|
| 1163 | + $shour = (int) dol_print_date($object->datep, "%H", 'tzuserrel'); // We take the date visible by user $newdate is also date visible by user. |
|
| 1164 | 1164 | $smin = (int) dol_print_date($object->datep, "%M", 'tzuserrel'); |
| 1165 | 1165 | |
| 1166 | 1166 | $newdate = GETPOST('newdate', 'alpha'); |
@@ -1334,7 +1334,7 @@ discard block |
||
| 1334 | 1334 | if (new_startdate > old_enddate) { |
| 1335 | 1335 | var timeDiff = old_enddate - old_startdate; |
| 1336 | 1336 | var new_enddate = new Date(new_startdate.getTime() + timeDiff); |
| 1337 | - $("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput') . '")); |
|
| 1337 | + $("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput').'")); |
|
| 1338 | 1338 | $("#p2day").val(new_enddate.getDate()); |
| 1339 | 1339 | $("#p2month").val(new_enddate.getMonth() + 1); |
| 1340 | 1340 | $("#p2year").val(new_enddate.getFullYear()); |
@@ -1392,7 +1392,7 @@ discard block |
||
| 1392 | 1392 | $default = getDolGlobalString('AGENDA_USE_EVENT_TYPE_DEFAULT', 'AC_RDV'); |
| 1393 | 1393 | print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"'); |
| 1394 | 1394 | $selectedvalue = GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default); |
| 1395 | - print $formactions->select_type_actions($selectedvalue, "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot |
|
| 1395 | + print $formactions->select_type_actions($selectedvalue, "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot |
|
| 1396 | 1396 | print '</td></tr>'; |
| 1397 | 1397 | } |
| 1398 | 1398 | |
@@ -1731,7 +1731,7 @@ discard block |
||
| 1731 | 1731 | } |
| 1732 | 1732 | //var_dump('origin='.$origin.' originid='.$originid.' hasPermissionOnLinkedObject='.$hasPermissionOnLinkedObject); |
| 1733 | 1733 | |
| 1734 | - if (! in_array($origin, array('societe', 'project', 'task', 'user'))) { |
|
| 1734 | + if (!in_array($origin, array('societe', 'project', 'task', 'user'))) { |
|
| 1735 | 1735 | // We do not use link for object that already contains a hard coded field to make links with agenda events |
| 1736 | 1736 | print '<tr><td class="titlefieldcreate">'.$langs->trans("LinkedObject").'</td>'; |
| 1737 | 1737 | print '<td colspan="3">'; |
@@ -1820,7 +1820,7 @@ discard block |
||
| 1820 | 1820 | $("#addreminder").prop("checked", true); |
| 1821 | 1821 | |
| 1822 | 1822 | // Set period with default reminder period |
| 1823 | - $("[name=\"offsetvalue\"]").val("' . $reminderDefaultOffset . '"); |
|
| 1823 | + $("[name=\"offsetvalue\"]").val("' . $reminderDefaultOffset.'"); |
|
| 1824 | 1824 | $("#select_offsetunittype_duration").select2("destroy"); |
| 1825 | 1825 | $("#select_offsetunittype_duration").val("'.$reminderDefaultUnit.'"); |
| 1826 | 1826 | $("#select_offsetunittype_duration").select2(); |
@@ -1917,7 +1917,7 @@ discard block |
||
| 1917 | 1917 | $object->socpeopleassigned[$id] = array('id' => $tmpid); |
| 1918 | 1918 | } |
| 1919 | 1919 | $object->contact_id = GETPOSTINT("contactid"); |
| 1920 | - $object->fk_project = GETPOSTINT("projectid"); |
|
| 1920 | + $object->fk_project = GETPOSTINT("projectid"); |
|
| 1921 | 1921 | |
| 1922 | 1922 | $object->note_private = GETPOST("note", 'restricthtml'); |
| 1923 | 1923 | } |
@@ -1991,7 +1991,7 @@ discard block |
||
| 1991 | 1991 | if (new_startdate > old_enddate) { |
| 1992 | 1992 | var timeDiff = old_enddate - old_startdate; |
| 1993 | 1993 | var new_enddate = new Date(new_startdate.getTime() + timeDiff); |
| 1994 | - $("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput') . '")); |
|
| 1994 | + $("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput').'")); |
|
| 1995 | 1995 | $("#p2day").val(new_enddate.getDate()); |
| 1996 | 1996 | $("#p2month").val(new_enddate.getMonth() + 1); |
| 1997 | 1997 | $("#p2year").val(new_enddate.getFullYear()); |
@@ -2016,7 +2016,7 @@ discard block |
||
| 2016 | 2016 | if ($backtopage) { |
| 2017 | 2017 | print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : '').'">'; |
| 2018 | 2018 | } |
| 2019 | - if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') && ! preg_match('/^TICKET_MSG_PRIVATE/', $object->code)) { |
|
| 2019 | + if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') && !preg_match('/^TICKET_MSG_PRIVATE/', $object->code)) { |
|
| 2020 | 2020 | print '<input type="hidden" name="actioncode" value="'.$object->type_code.'">'; |
| 2021 | 2021 | } |
| 2022 | 2022 | |
@@ -2440,7 +2440,7 @@ discard block |
||
| 2440 | 2440 | }); |
| 2441 | 2441 | })'; |
| 2442 | 2442 | print '</script>'."\n"; |
| 2443 | - print '</div>'; // End of div for reminderparameters |
|
| 2443 | + print '</div>'; // End of div for reminderparameters |
|
| 2444 | 2444 | } |
| 2445 | 2445 | |
| 2446 | 2446 | print dol_get_fiche_end(); |
@@ -2712,7 +2712,7 @@ discard block |
||
| 2712 | 2712 | |
| 2713 | 2713 | // Priority |
| 2714 | 2714 | if (getDolGlobalString('AGENDA_SUPPORT_PRIORITY_IN_EVENTS')) { |
| 2715 | - print '<tr><td class="nowrap" class="titlefield">' . $langs->trans("Priority") . '</td><td>'; |
|
| 2715 | + print '<tr><td class="nowrap" class="titlefield">'.$langs->trans("Priority").'</td><td>'; |
|
| 2716 | 2716 | print($object->priority ? $object->priority : ''); |
| 2717 | 2717 | print '</td></tr>'; |
| 2718 | 2718 | } |
@@ -102,8 +102,8 @@ discard block |
||
| 102 | 102 | $object = new Contrat($db); |
| 103 | 103 | $extrafields = new ExtraFields($db); |
| 104 | 104 | $ret = 0; |
| 105 | -$pu_ht = null; // Init for static analysis |
|
| 106 | -$pu_ttc = null; // Init for static analysis |
|
| 105 | +$pu_ht = null; // Init for static analysis |
|
| 106 | +$pu_ttc = null; // Init for static analysis |
|
| 107 | 107 | |
| 108 | 108 | // Load object |
| 109 | 109 | if ($id > 0 || !empty($ref) && $action != 'add') { |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $permissionnote = $user->hasRight('contrat', 'creer'); // Used by the include of actions_setnotes.inc.php |
| 126 | 126 | $permissiondellink = $user->hasRight('contrat', 'creer'); // Used by the include of actions_dellink.inc.php |
| 127 | 127 | $permissiontodelete = ($user->hasRight('contrat', 'creer') && $object->status == $object::STATUS_DRAFT) || $user->hasRight('contrat', 'supprimer'); |
| 128 | -$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
| 128 | +$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
| 129 | 129 | $permissiontoedit = $permissiontoadd; |
| 130 | 130 | $permissiontoactivate = $user->hasRight('contrat', 'activer'); |
| 131 | 131 | $error = 0; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
| 172 | 172 | |
| 173 | - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
| 173 | + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
| 174 | 174 | |
| 175 | 175 | if ($action == 'confirm_active' && $confirm == 'yes' && $permissiontoactivate) { |
| 176 | 176 | $date_start = ''; |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | } elseif ($action == 'confirm_sign' && $confirm == 'yes' && $user->hasRight('contract', 'creer')) { |
| 194 | 194 | $result = $object->setSignedStatus($user, GETPOSTINT('signed_status'), 0, 'CONTRACT_MODIFY'); |
| 195 | 195 | if ($result >= 0) { |
| 196 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 196 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 197 | 197 | exit; |
| 198 | 198 | } else { |
| 199 | 199 | $mesg = $object->error; |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | } elseif ($action == 'confirm_unsign' && $confirm == 'yes' && $user->hasRight('contract', 'creer')) { |
| 202 | 202 | $result = $object->setSignedStatus($user, Contrat::$SIGNED_STATUSES['STATUS_NO_SIGNATURE'], 0, 'CONTRACT_MODIFY'); |
| 203 | 203 | if ($result >= 0) { |
| 204 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 204 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 205 | 205 | exit; |
| 206 | 206 | } else { |
| 207 | 207 | $mesg = $object->error; |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | |
| 333 | 333 | $classname = ucfirst($subelement); |
| 334 | 334 | $srcobject = new $classname($db); |
| 335 | - '@phan-var-force Commande|Propal|Facture $srcobject'; // Can be other class, but CommonObject is too Generic |
|
| 335 | + '@phan-var-force Commande|Propal|Facture $srcobject'; // Can be other class, but CommonObject is too Generic |
|
| 336 | 336 | |
| 337 | 337 | dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); |
| 338 | 338 | $result = $srcobject->fetch($object->origin_id); |
@@ -567,8 +567,8 @@ discard block |
||
| 567 | 567 | $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); |
| 568 | 568 | if ($result) { |
| 569 | 569 | if (count($prodcustprice->lines) > 0) { |
| 570 | - $price_min = price($prodcustprice->lines[0]->price_min); |
|
| 571 | - $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
| 570 | + $price_min = price($prodcustprice->lines[0]->price_min); |
|
| 571 | + $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
| 572 | 572 | /*$tva_tx = $prodcustprice->lines[0]->tva_tx; |
| 573 | 573 | if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) { |
| 574 | 574 | $tva_tx .= ' ('.$prodcustprice->lines[0]->default_vat_code.')'; |
@@ -754,7 +754,7 @@ discard block |
||
| 754 | 754 | } |
| 755 | 755 | $objectline->fetch_optionals(); |
| 756 | 756 | |
| 757 | - $objectline->oldcopy = dol_clone($objectline, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 757 | + $objectline->oldcopy = dol_clone($objectline, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 758 | 758 | } else { |
| 759 | 759 | $objectline = null; |
| 760 | 760 | } |
@@ -803,7 +803,7 @@ discard block |
||
| 803 | 803 | // update price_ht with discount |
| 804 | 804 | // TODO Use object->updateline instead objectline->update |
| 805 | 805 | |
| 806 | - $price_ht = price2num(GETPOST('elprice'), 'MU'); |
|
| 806 | + $price_ht = price2num(GETPOST('elprice'), 'MU'); |
|
| 807 | 807 | $remise_percent = price2num(GETPOST('elremise_percent'), '', 2); |
| 808 | 808 | if ($remise_percent > 0) { |
| 809 | 809 | $remise = round(((float) $price_ht * (float) $remise_percent / 100), 2); |
@@ -910,7 +910,7 @@ discard block |
||
| 910 | 910 | } elseif ($action == 'confirm_activate' && $confirm == 'yes' && $user->hasRight('contrat', 'creer')) { |
| 911 | 911 | $date_start = dol_mktime(12, 0, 0, GETPOSTINT('d_startmonth'), GETPOSTINT('d_startday'), GETPOSTINT('d_startyear')); |
| 912 | 912 | $date_end = dol_mktime(12, 0, 0, GETPOSTINT('d_endmonth'), GETPOSTINT('d_endday'), GETPOSTINT('d_endyear')); |
| 913 | - $comment = GETPOST('comment', 'alpha'); |
|
| 913 | + $comment = GETPOST('comment', 'alpha'); |
|
| 914 | 914 | $result = $object->activateAll($user, $date_start, 0, $comment, $date_end); |
| 915 | 915 | if ($result < 0) { |
| 916 | 916 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -1472,7 +1472,7 @@ discard block |
||
| 1472 | 1472 | $morehtmlref .= '<div class="refidno">'; |
| 1473 | 1473 | // Ref customer |
| 1474 | 1474 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 1); |
| 1475 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1, 'getFormatedCustomerRef'); |
|
| 1475 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1, 'getFormatedCustomerRef'); |
|
| 1476 | 1476 | // Ref supplier |
| 1477 | 1477 | $morehtmlref .= '<br>'; |
| 1478 | 1478 | $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 1); |
@@ -1566,7 +1566,7 @@ discard block |
||
| 1566 | 1566 | } |
| 1567 | 1567 | |
| 1568 | 1568 | |
| 1569 | - $arrayothercontracts = $object->getListOfContracts('others'); // array or -1 if technical error |
|
| 1569 | + $arrayothercontracts = $object->getListOfContracts('others'); // array or -1 if technical error |
|
| 1570 | 1570 | |
| 1571 | 1571 | /* |
| 1572 | 1572 | * Lines of contracts |
@@ -1819,7 +1819,7 @@ discard block |
||
| 1819 | 1819 | print $objp->label ? ' - '.dol_trunc($objp->label, 32) : ''; |
| 1820 | 1820 | print '<input type="hidden" name="idprod" value="'.$currentLineProductId.'">'; |
| 1821 | 1821 | } else { |
| 1822 | - $senderissupplier = 0; // @TODO Option to allow purchased products ? |
|
| 1822 | + $senderissupplier = 0; // @TODO Option to allow purchased products ? |
|
| 1823 | 1823 | if (empty($senderissupplier)) { |
| 1824 | 1824 | if (getDolGlobalString('CONTRACT_SUPPORT_PRODUCTS')) { |
| 1825 | 1825 | $filtertype = ''; |
@@ -2321,9 +2321,9 @@ discard block |
||
| 2321 | 2321 | // Sign |
| 2322 | 2322 | if ($object->status > Contrat::STATUS_DRAFT) { |
| 2323 | 2323 | if ($object->signed_status != Contrat::$SIGNED_STATUSES['STATUS_SIGNED_ALL']) { |
| 2324 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=sign&token=' . newToken() . '">' . $langs->trans("ContractSign") . '</a></div>'; |
|
| 2324 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=sign&token='.newToken().'">'.$langs->trans("ContractSign").'</a></div>'; |
|
| 2325 | 2325 | } else { |
| 2326 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=unsign&token=' . newToken() . '">' . $langs->trans("ContractUnsign") . '</a></div>'; |
|
| 2326 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=unsign&token='.newToken().'">'.$langs->trans("ContractUnsign").'</a></div>'; |
|
| 2327 | 2327 | } |
| 2328 | 2328 | } |
| 2329 | 2329 | |