@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | $this->mode_reglement_id = 0; |
| 505 | 505 | } |
| 506 | 506 | $this->status = self::STATUS_DRAFT; |
| 507 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
| 507 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
| 508 | 508 | |
| 509 | 509 | if (!empty($this->multicurrency_code)) { |
| 510 | 510 | // Multicurrency (test on $this->multicurrency_tx because we should take the default rate of multicurrency_code only if not using original rate) |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | if (!empty($_facrec->frequency)) { // Invoice are created on same thirdparty than template when there is a recurrence, but not necessarily when there is no recurrence. |
| 579 | 579 | $this->socid = $_facrec->socid; |
| 580 | 580 | } |
| 581 | - $this->entity = $_facrec->entity; // Invoice created in same entity than template |
|
| 581 | + $this->entity = $_facrec->entity; // Invoice created in same entity than template |
|
| 582 | 582 | |
| 583 | 583 | // Fields coming from GUI. |
| 584 | 584 | // @TODO Value of template should be used as default value on the form on the GUI, and we should here always use the value from GUI |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | $this->mode_reglement_id = 0; |
| 618 | 618 | } |
| 619 | 619 | $this->status = self::STATUS_DRAFT; |
| 620 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
| 620 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
| 621 | 621 | |
| 622 | 622 | $this->linked_objects = $_facrec->linkedObjectsIds; |
| 623 | 623 | // We do not add link to template invoice or next invoice will be linked to all generated invoices |
@@ -863,7 +863,7 @@ discard block |
||
| 863 | 863 | |
| 864 | 864 | // Complete vat rate with code |
| 865 | 865 | $vatrate = $newinvoiceline->tva_tx; |
| 866 | - if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', (string) $vatrate)) { |
|
| 866 | + if ($newinvoiceline->vat_src_code && !preg_match('/\(.*\)/', (string) $vatrate)) { |
|
| 867 | 867 | $vatrate .= ' ('.$newinvoiceline->vat_src_code.')'; |
| 868 | 868 | } |
| 869 | 869 | |
@@ -1083,7 +1083,7 @@ discard block |
||
| 1083 | 1083 | ($_facrec->lines[$i]->date_end_fill == 1 && $previousdaynextdatewhen) ? $previousdaynextdatewhen : '', |
| 1084 | 1084 | 0, |
| 1085 | 1085 | $tva_npr, |
| 1086 | - 0, // fk_remise_except |
|
| 1086 | + 0, // fk_remise_except |
|
| 1087 | 1087 | 'HT', |
| 1088 | 1088 | 0, |
| 1089 | 1089 | $_facrec->lines[$i]->product_type, |
@@ -1096,8 +1096,8 @@ discard block |
||
| 1096 | 1096 | $buyprice, |
| 1097 | 1097 | $_facrec->lines[$i]->label, |
| 1098 | 1098 | empty($_facrec->lines[$i]->array_options) ? null : $_facrec->lines[$i]->array_options, |
| 1099 | - 100, // situation percent is undefined on recurring invoice lines |
|
| 1100 | - 0, // fk_prev_id |
|
| 1099 | + 100, // situation percent is undefined on recurring invoice lines |
|
| 1100 | + 0, // fk_prev_id |
|
| 1101 | 1101 | $_facrec->lines[$i]->fk_unit, |
| 1102 | 1102 | $_facrec->lines[$i]->multicurrency_subprice, |
| 1103 | 1103 | $_facrec->lines[$i]->ref_ext, |
@@ -1189,7 +1189,7 @@ discard block |
||
| 1189 | 1189 | |
| 1190 | 1190 | $facture->fk_facture_source = $this->fk_facture_source; |
| 1191 | 1191 | $facture->type = $this->type; |
| 1192 | - $facture->subtype = $this->subtype; |
|
| 1192 | + $facture->subtype = $this->subtype; |
|
| 1193 | 1193 | $facture->socid = $this->socid; |
| 1194 | 1194 | $facture->date = $this->date; |
| 1195 | 1195 | $facture->date_pointoftax = $this->date_pointoftax; |
@@ -1206,7 +1206,7 @@ discard block |
||
| 1206 | 1206 | |
| 1207 | 1207 | $facture->origin = $this->origin; |
| 1208 | 1208 | $facture->origin_id = $this->origin_id; |
| 1209 | - $facture->fk_account = $this->fk_account; |
|
| 1209 | + $facture->fk_account = $this->fk_account; |
|
| 1210 | 1210 | |
| 1211 | 1211 | $facture->lines = $this->lines; // Array of lines of invoice |
| 1212 | 1212 | $facture->situation_counter = $this->situation_counter; |
@@ -1473,8 +1473,8 @@ discard block |
||
| 1473 | 1473 | $this->fk_account = $object->fk_account; |
| 1474 | 1474 | $this->cond_reglement_id = $object->cond_reglement_id; |
| 1475 | 1475 | $this->mode_reglement_id = $object->mode_reglement_id; |
| 1476 | - $this->fk_incoterms = $object->fk_incoterms; |
|
| 1477 | - $this->location_incoterms = $object->location_incoterms; |
|
| 1476 | + $this->fk_incoterms = $object->fk_incoterms; |
|
| 1477 | + $this->location_incoterms = $object->location_incoterms; |
|
| 1478 | 1478 | $this->availability_id = $object->availability_id; |
| 1479 | 1479 | $this->demand_reason_id = $object->demand_reason_id; |
| 1480 | 1480 | $this->delivery_date = $object->delivery_date; |
@@ -1682,7 +1682,7 @@ discard block |
||
| 1682 | 1682 | { |
| 1683 | 1683 | global $conf, $langs, $hookmanager, $action; |
| 1684 | 1684 | |
| 1685 | - if (! in_array($origin->element, array('propal', 'commande'))) { |
|
| 1685 | + if (!in_array($origin->element, array('propal', 'commande'))) { |
|
| 1686 | 1686 | $origin->error = 'ErrorCanOnlyAutomaticallyGenerateADepositFromProposalOrOrder'; |
| 1687 | 1687 | return null; |
| 1688 | 1688 | } |
@@ -1692,7 +1692,7 @@ discard block |
||
| 1692 | 1692 | return null; |
| 1693 | 1693 | } |
| 1694 | 1694 | |
| 1695 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 1695 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 1696 | 1696 | |
| 1697 | 1697 | if ($date > (dol_get_last_hour(dol_now('tzuserrel')) + getDolGlobalInt('INVOICE_MAX_FUTURE_DELAY'))) { |
| 1698 | 1698 | $origin->error = 'ErrorDateIsInFuture'; |
@@ -1736,7 +1736,7 @@ discard block |
||
| 1736 | 1736 | $deposit->pos_source = $origin->pos_source; |
| 1737 | 1737 | $deposit->model_pdf = 'crabe'; |
| 1738 | 1738 | |
| 1739 | - $modelByTypeConfName = 'FACTURE_ADDON_PDF_' . $deposit->type; |
|
| 1739 | + $modelByTypeConfName = 'FACTURE_ADDON_PDF_'.$deposit->type; |
|
| 1740 | 1740 | |
| 1741 | 1741 | if (getDolGlobalString($modelByTypeConfName)) { |
| 1742 | 1742 | $deposit->model_pdf = getDolGlobalString($modelByTypeConfName); |
@@ -1796,10 +1796,10 @@ discard block |
||
| 1796 | 1796 | $descriptions[$key] = ''; |
| 1797 | 1797 | } |
| 1798 | 1798 | $TTotalByTva[$key] += $line->total_ttc; |
| 1799 | - $descriptions[$key] .= '<li>' . (!empty($line->product_ref) ? $line->product_ref . ' - ' : ''); |
|
| 1800 | - $descriptions[$key] .= (!empty($line->product_label) ? $line->product_label . ' - ' : ''); |
|
| 1801 | - $descriptions[$key] .= $langs->trans('Qty') . ' : ' . $line->qty; |
|
| 1802 | - $descriptions[$key] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($line->total_ht) . '</li>'; |
|
| 1799 | + $descriptions[$key] .= '<li>'.(!empty($line->product_ref) ? $line->product_ref.' - ' : ''); |
|
| 1800 | + $descriptions[$key] .= (!empty($line->product_label) ? $line->product_label.' - ' : ''); |
|
| 1801 | + $descriptions[$key] .= $langs->trans('Qty').' : '.$line->qty; |
|
| 1802 | + $descriptions[$key] .= ' - '.$langs->trans('TotalHT').' : '.price($line->total_ht).'</li>'; |
|
| 1803 | 1803 | } |
| 1804 | 1804 | |
| 1805 | 1805 | foreach ($TTotalByTva as $tva => &$total) { |
@@ -1823,10 +1823,10 @@ discard block |
||
| 1823 | 1823 | $totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ? |
| 1824 | 1824 | $tva_tx = $lines[$i]->tva_tx; |
| 1825 | 1825 | $amountdeposit[$tva_tx] += ((float) $lines[$i]->total_ht * (float) $origin->deposit_percent) / 100; |
| 1826 | - $descriptions[$tva_tx] .= '<li>' . (!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref . ' - ' : ''); |
|
| 1827 | - $descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label . ' - ' : ''); |
|
| 1828 | - $descriptions[$tva_tx] .= $langs->trans('Qty') . ' : ' . $lines[$i]->qty; |
|
| 1829 | - $descriptions[$tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($lines[$i]->total_ht) . '</li>'; |
|
| 1826 | + $descriptions[$tva_tx] .= '<li>'.(!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref.' - ' : ''); |
|
| 1827 | + $descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label.' - ' : ''); |
|
| 1828 | + $descriptions[$tva_tx] .= $langs->trans('Qty').' : '.$lines[$i]->qty; |
|
| 1829 | + $descriptions[$tva_tx] .= ' - '.$langs->trans('TotalHT').' : '.price($lines[$i]->total_ht).'</li>'; |
|
| 1830 | 1830 | } |
| 1831 | 1831 | |
| 1832 | 1832 | if ($totalamount == 0) { |
@@ -1841,11 +1841,11 @@ discard block |
||
| 1841 | 1841 | continue; |
| 1842 | 1842 | } |
| 1843 | 1843 | |
| 1844 | - $descline = '(DEPOSIT) ('. $origin->deposit_percent .'%) - '.$origin->ref; |
|
| 1844 | + $descline = '(DEPOSIT) ('.$origin->deposit_percent.'%) - '.$origin->ref; |
|
| 1845 | 1845 | |
| 1846 | 1846 | // Hidden conf |
| 1847 | 1847 | if (getDolGlobalString('INVOICE_DEPOSIT_VARIABLE_MODE_DETAIL_LINES_IN_DESCRIPTION') && !empty($descriptions[$tva])) { |
| 1848 | - $descline .= '<ul>' . $descriptions[$tva] . '</ul>'; |
|
| 1848 | + $descline .= '<ul>'.$descriptions[$tva].'</ul>'; |
|
| 1849 | 1849 | } |
| 1850 | 1850 | |
| 1851 | 1851 | $addlineResult = $deposit->addline( |
@@ -2225,9 +2225,9 @@ discard block |
||
| 2225 | 2225 | $this->id = $obj->rowid; |
| 2226 | 2226 | $this->entity = $obj->entity; |
| 2227 | 2227 | |
| 2228 | - $this->ref = $obj->ref; |
|
| 2229 | - $this->ref_client = $obj->ref_client; |
|
| 2230 | - $this->ref_customer = $obj->ref_client; |
|
| 2228 | + $this->ref = $obj->ref; |
|
| 2229 | + $this->ref_client = $obj->ref_client; |
|
| 2230 | + $this->ref_customer = $obj->ref_client; |
|
| 2231 | 2231 | $this->ref_ext = $obj->ref_ext; |
| 2232 | 2232 | $this->type = $obj->type; |
| 2233 | 2233 | $this->subtype = $obj->subtype; |
@@ -2253,7 +2253,7 @@ discard block |
||
| 2253 | 2253 | $this->fk_project = $obj->fk_project; |
| 2254 | 2254 | $this->project = null; // Clear if another value was already set by fetch_projet |
| 2255 | 2255 | |
| 2256 | - $this->statut = $obj->status; // deprecated |
|
| 2256 | + $this->statut = $obj->status; // deprecated |
|
| 2257 | 2257 | $this->status = $obj->status; |
| 2258 | 2258 | |
| 2259 | 2259 | $this->date_lim_reglement = $this->db->jdate($obj->dlr); |
@@ -2269,7 +2269,7 @@ discard block |
||
| 2269 | 2269 | $this->fk_fac_rec_source = $obj->fk_fac_rec_source; |
| 2270 | 2270 | $this->note = $obj->note_private; // deprecated |
| 2271 | 2271 | $this->note_private = $obj->note_private; |
| 2272 | - $this->note_public = $obj->note_public; |
|
| 2272 | + $this->note_public = $obj->note_public; |
|
| 2273 | 2273 | $this->user_creation_id = $obj->fk_user_author; |
| 2274 | 2274 | $this->user_validation_id = $obj->fk_user_valid; |
| 2275 | 2275 | $this->user_modification_id = $obj->fk_user_modif; |
@@ -2383,7 +2383,7 @@ discard block |
||
| 2383 | 2383 | $line->ref = $objp->product_ref; // Ref product |
| 2384 | 2384 | $line->product_ref = $objp->product_ref; // Ref product |
| 2385 | 2385 | $line->libelle = $objp->product_label; // deprecated |
| 2386 | - $line->product_label = $objp->product_label; // Label product |
|
| 2386 | + $line->product_label = $objp->product_label; // Label product |
|
| 2387 | 2387 | $line->product_barcode = $objp->product_barcode; // Barcode number product |
| 2388 | 2388 | $line->product_desc = $objp->product_desc; // Description product |
| 2389 | 2389 | $line->fk_product_type = $objp->fk_product_type; // Type of product |
@@ -3257,10 +3257,10 @@ discard block |
||
| 3257 | 3257 | if ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('facture', 'creer')) |
| 3258 | 3258 | || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('facture', 'invoice_advance', 'validate'))) { |
| 3259 | 3259 | $this->error = 'Permission denied'; |
| 3260 | - dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS=' . getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR); |
|
| 3260 | + dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS='.getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR); |
|
| 3261 | 3261 | return -1; |
| 3262 | 3262 | } |
| 3263 | - if ((preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) && // empty should not happened, but when it occurs, the test save life |
|
| 3263 | + if ((preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) && // empty should not happened, but when it occurs, the test save life |
|
| 3264 | 3264 | getDolGlobalString('FAC_FORCE_DATE_VALIDATION') // If option enabled, we force invoice date |
| 3265 | 3265 | ) { |
| 3266 | 3266 | $this->date = dol_now(); |
@@ -3438,7 +3438,7 @@ discard block |
||
| 3438 | 3438 | for ($i = 0; $i < $cpt; $i++) { |
| 3439 | 3439 | if ($this->lines[$i]->fk_product > 0) { |
| 3440 | 3440 | $mouvP = new MouvementStock($this->db); |
| 3441 | - $mouvP->origin = &$this; // deprecated |
|
| 3441 | + $mouvP->origin = &$this; // deprecated |
|
| 3442 | 3442 | $mouvP->setOrigin($this->element, $this->id); |
| 3443 | 3443 | |
| 3444 | 3444 | // We decrease stock for product |
@@ -3632,7 +3632,7 @@ discard block |
||
| 3632 | 3632 | // Set new ref and define current status |
| 3633 | 3633 | if (!$error) { |
| 3634 | 3634 | $this->ref = $num; |
| 3635 | - $this->statut = self::STATUS_VALIDATED; // deprecated |
|
| 3635 | + $this->statut = self::STATUS_VALIDATED; // deprecated |
|
| 3636 | 3636 | $this->status = self::STATUS_VALIDATED; |
| 3637 | 3637 | $this->date_validation = $now; |
| 3638 | 3638 | $i = 0; |
@@ -3787,7 +3787,7 @@ discard block |
||
| 3787 | 3787 | |
| 3788 | 3788 | if ($error == 0) { |
| 3789 | 3789 | $old_statut = $this->status; |
| 3790 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
| 3790 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
| 3791 | 3791 | $this->status = self::STATUS_DRAFT; |
| 3792 | 3792 | |
| 3793 | 3793 | // Call trigger |
@@ -4692,7 +4692,7 @@ discard block |
||
| 4692 | 4692 | } |
| 4693 | 4693 | |
| 4694 | 4694 | if (!empty($addon)) { |
| 4695 | - dol_syslog("Call getNextNumRef with ".$addonConstName." = " . getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG); |
|
| 4695 | + dol_syslog("Call getNextNumRef with ".$addonConstName." = ".getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG); |
|
| 4696 | 4696 | |
| 4697 | 4697 | $mybool = false; |
| 4698 | 4698 | |
@@ -5159,7 +5159,7 @@ discard block |
||
| 5159 | 5159 | |
| 5160 | 5160 | if (empty($option) || $option != 'nolines') { |
| 5161 | 5161 | // Lines |
| 5162 | - $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
| 5162 | + $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
| 5163 | 5163 | $xnbp = 0; |
| 5164 | 5164 | while ($xnbp < $nbp) { |
| 5165 | 5165 | $line = new FactureLigne($this->db); |
@@ -5772,14 +5772,14 @@ discard block |
||
| 5772 | 5772 | if (!empty($paymentmode) && $paymentmode != 'all') { |
| 5773 | 5773 | $sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp"; |
| 5774 | 5774 | } |
| 5775 | - $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
| 5776 | - $sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status |
|
| 5775 | + $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
| 5776 | + $sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status |
|
| 5777 | 5777 | if ($datetouse == 'invoicedate') { |
| 5778 | 5778 | $sql .= " AND f.datef = '".$this->db->idate($tmpidate, 'gmt')."'"; |
| 5779 | 5779 | } else { |
| 5780 | 5780 | $sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'"; |
| 5781 | 5781 | } |
| 5782 | - $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing) |
|
| 5782 | + $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing) |
|
| 5783 | 5783 | if (!empty($paymentmode) && $paymentmode != 'all') { |
| 5784 | 5784 | $sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'"; |
| 5785 | 5785 | } |
@@ -5997,7 +5997,7 @@ discard block |
||
| 5997 | 5997 | $actioncomm->create($user); |
| 5998 | 5998 | } |
| 5999 | 5999 | |
| 6000 | - $this->db->commit(); // We always commit |
|
| 6000 | + $this->db->commit(); // We always commit |
|
| 6001 | 6001 | } |
| 6002 | 6002 | |
| 6003 | 6003 | if ($errormesg) { |
@@ -6039,7 +6039,7 @@ discard block |
||
| 6039 | 6039 | // get date of last validated invoices of same type |
| 6040 | 6040 | $sql = "SELECT datef"; |
| 6041 | 6041 | $sql .= " FROM ".MAIN_DB_PREFIX."facture"; |
| 6042 | - $sql .= " WHERE type = " . (int) $this->type ; |
|
| 6042 | + $sql .= " WHERE type = ".(int) $this->type; |
|
| 6043 | 6043 | $sql .= " AND date_valid IS NOT NULL"; |
| 6044 | 6044 | $sql .= " AND entity IN (".getEntity('invoice').")"; |
| 6045 | 6045 | $sql .= " ORDER BY datef DESC LIMIT 1"; |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 118 | 118 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
| 119 | 119 | $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); |
| 120 | -$confirm = GETPOST('confirm', 'alpha'); |
|
| 120 | +$confirm = GETPOST('confirm', 'alpha'); |
|
| 121 | 121 | |
| 122 | 122 | $dol_openinpopup = ''; |
| 123 | 123 | if (!empty($backtopagejsfields)) { |
@@ -164,12 +164,12 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | // Permissions |
| 167 | -$permissiontoread = $user->hasRight('societe', 'lire'); |
|
| 168 | -$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
| 167 | +$permissiontoread = $user->hasRight('societe', 'lire'); |
|
| 168 | +$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
| 169 | 169 | $permissiontodelete = $user->hasRight('societe', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == 0); |
| 170 | -$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php |
|
| 170 | +$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php |
|
| 171 | 171 | $permissiondellink = $user->hasRight('societe', 'creer'); // Used by the include of actions_dellink.inc.php |
| 172 | -$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; |
|
| 172 | +$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; |
|
| 173 | 173 | |
| 174 | 174 | // Security check |
| 175 | 175 | $result = restrictedArea($user, 'societe', $object->id, '&societe', '', 'fk_soc', 'rowid', 0); |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | |
| 217 | 217 | if ($action == 'confirm_merge' && $confirm == 'yes' && $permissiontoadd) { |
| 218 | 218 | $soc_origin_id = GETPOSTINT('soc_origin'); |
| 219 | - $soc_origin = new Societe($db); // The thirdparty that we will delete |
|
| 219 | + $soc_origin = new Societe($db); // The thirdparty that we will delete |
|
| 220 | 220 | |
| 221 | 221 | if ($soc_origin_id <= 0) { |
| 222 | 222 | $langs->load('errors'); |
@@ -332,19 +332,19 @@ discard block |
||
| 332 | 332 | $object->name = dolGetFirstLastname(GETPOST('firstname', 'alphanohtml'), GETPOST('name', 'alphanohtml')); |
| 333 | 333 | $object->civility_id = GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int |
| 334 | 334 | // Add non official properties |
| 335 | - $object->name_bis = GETPOST('name', 'alphanohtml'); |
|
| 336 | - $object->firstname = GETPOST('firstname', 'alphanohtml'); |
|
| 335 | + $object->name_bis = GETPOST('name', 'alphanohtml'); |
|
| 336 | + $object->firstname = GETPOST('firstname', 'alphanohtml'); |
|
| 337 | 337 | } else { |
| 338 | - $object->name = GETPOST('name', 'alphanohtml'); |
|
| 338 | + $object->name = GETPOST('name', 'alphanohtml'); |
|
| 339 | 339 | } |
| 340 | 340 | $object->entity = ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity); |
| 341 | - $object->name_alias = GETPOST('name_alias', 'alphanohtml'); |
|
| 341 | + $object->name_alias = GETPOST('name_alias', 'alphanohtml'); |
|
| 342 | 342 | $object->parent = GETPOSTISSET('parent_company_id') ? GETPOSTINT('parent_company_id') : $object->parent; |
| 343 | 343 | $object->address = GETPOST('address', 'alphanohtml'); |
| 344 | - $object->zip = GETPOST('zipcode', 'alphanohtml'); |
|
| 345 | - $object->town = GETPOST('town', 'alphanohtml'); |
|
| 346 | - $object->country_id = GETPOSTINT('country_id'); |
|
| 347 | - $object->state_id = GETPOSTINT('state_id'); |
|
| 344 | + $object->zip = GETPOST('zipcode', 'alphanohtml'); |
|
| 345 | + $object->town = GETPOST('town', 'alphanohtml'); |
|
| 346 | + $object->country_id = GETPOSTINT('country_id'); |
|
| 347 | + $object->state_id = GETPOSTINT('state_id'); |
|
| 348 | 348 | |
| 349 | 349 | $object->socialnetworks = array(); |
| 350 | 350 | if (isModEnabled('socialnetworks')) { |
@@ -356,10 +356,10 @@ discard block |
||
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | $object->phone = GETPOST('phone', 'alpha'); |
| 359 | - $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
| 359 | + $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
| 360 | 360 | $object->fax = GETPOST('fax', 'alpha'); |
| 361 | 361 | $object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); |
| 362 | - $object->no_email = GETPOSTINT("no_email"); |
|
| 362 | + $object->no_email = GETPOSTINT("no_email"); |
|
| 363 | 363 | $object->url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL)); |
| 364 | 364 | $object->idprof1 = trim(GETPOST('idprof1', 'alphanohtml')); |
| 365 | 365 | $object->idprof2 = trim(GETPOST('idprof2', 'alphanohtml')); |
@@ -369,13 +369,13 @@ discard block |
||
| 369 | 369 | $object->idprof6 = trim(GETPOST('idprof6', 'alphanohtml')); |
| 370 | 370 | $object->prefix_comm = GETPOST('prefix_comm', 'alphanohtml'); |
| 371 | 371 | $object->code_client = GETPOSTISSET('customer_code') ? GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha'); |
| 372 | - $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); |
|
| 372 | + $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); |
|
| 373 | 373 | $object->capital = GETPOSTFLOAT('capital'); |
| 374 | 374 | $object->barcode = GETPOST('barcode', 'alphanohtml'); |
| 375 | 375 | |
| 376 | 376 | $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); |
| 377 | 377 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
| 378 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 378 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 379 | 379 | $object->status = GETPOSTINT('status'); |
| 380 | 380 | |
| 381 | 381 | // Local Taxes |
@@ -385,9 +385,9 @@ discard block |
||
| 385 | 385 | $object->localtax1_value = GETPOST('lt1', 'alpha'); |
| 386 | 386 | $object->localtax2_value = GETPOST('lt2', 'alpha'); |
| 387 | 387 | |
| 388 | - $object->forme_juridique_code = GETPOSTINT('forme_juridique_code'); |
|
| 388 | + $object->forme_juridique_code = GETPOSTINT('forme_juridique_code'); |
|
| 389 | 389 | $object->effectif_id = GETPOSTINT('effectif_id'); |
| 390 | - $object->typent_id = GETPOSTINT('typent_id'); |
|
| 390 | + $object->typent_id = GETPOSTINT('typent_id'); |
|
| 391 | 391 | |
| 392 | 392 | $object->typent_code = dol_getIdFromCode($db, $object->typent_id, 'c_typent', 'id', 'code'); // Force typent_code too so check in verify() will be done on new type |
| 393 | 393 | |
@@ -396,8 +396,8 @@ discard block |
||
| 396 | 396 | $prospect = (GETPOSTINT('prospect') > 0 ? 2 : 0); |
| 397 | 397 | $prospectcustomer = $customer + $prospect; |
| 398 | 398 | |
| 399 | - $object->client = $prospectcustomer; |
|
| 400 | - $object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0); |
|
| 399 | + $object->client = $prospectcustomer; |
|
| 400 | + $object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0); |
|
| 401 | 401 | |
| 402 | 402 | if ($action == 'add') { |
| 403 | 403 | // for prospect, customer or supplier |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | if ($object->fournisseur > 0) { |
| 420 | - $object->cond_reglement_supplier_id = $paymentTermId; |
|
| 420 | + $object->cond_reglement_supplier_id = $paymentTermId; |
|
| 421 | 421 | |
| 422 | 422 | $filterPaymentTypeIdArr = array(1, 2, 3); // allow payment type for supplier (filter is "DBIT" in "Form::select_types_paiements()" method) |
| 423 | 423 | if (!empty($form->cache_types_paiements[$paymentTypeId]) && isset($form->cache_types_paiements[$paymentTypeId]['type']) && in_array($form->cache_types_paiements[$paymentTypeId]['type'], $filterPaymentTypeIdArr)) { |
@@ -427,15 +427,15 @@ discard block |
||
| 427 | 427 | } |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | - $object->commercial_id = GETPOSTINT('commercial_id'); |
|
| 431 | - $object->default_lang = GETPOST('default_lang'); |
|
| 430 | + $object->commercial_id = GETPOSTINT('commercial_id'); |
|
| 431 | + $object->default_lang = GETPOST('default_lang'); |
|
| 432 | 432 | |
| 433 | 433 | // Webservices url/key |
| 434 | 434 | $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); |
| 435 | 435 | $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); |
| 436 | 436 | |
| 437 | 437 | if (GETPOSTISSET('accountancy_code_sell')) { |
| 438 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 438 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 439 | 439 | |
| 440 | 440 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
| 441 | 441 | $object->accountancy_code_sell = ''; |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | } |
| 445 | 445 | } |
| 446 | 446 | if (GETPOSTISSET('accountancy_code_buy')) { |
| 447 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 447 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 448 | 448 | |
| 449 | 449 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
| 450 | 450 | $object->accountancy_code_buy = ''; |
@@ -915,7 +915,7 @@ discard block |
||
| 915 | 915 | } else { |
| 916 | 916 | $db->commit(); |
| 917 | 917 | $db->close(); |
| 918 | - header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); |
|
| 918 | + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); |
|
| 919 | 919 | exit; |
| 920 | 920 | } |
| 921 | 921 | } else { |
@@ -1096,21 +1096,21 @@ discard block |
||
| 1096 | 1096 | } |
| 1097 | 1097 | |
| 1098 | 1098 | $object->phone = GETPOST('phone', 'alpha'); |
| 1099 | - $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
| 1099 | + $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
| 1100 | 1100 | $object->fax = GETPOST('fax', 'alpha'); |
| 1101 | 1101 | $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); |
| 1102 | 1102 | $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); |
| 1103 | - $object->capital = GETPOSTFLOAT('capital'); |
|
| 1103 | + $object->capital = GETPOSTFLOAT('capital'); |
|
| 1104 | 1104 | $paymentTermId = GETPOSTINT('cond_reglement_id'); // can be set by default values on create page and not already in get or post variables |
| 1105 | 1105 | if (empty($paymentTermId) && !GETPOSTISSET('cond_reglement_id')) { |
| 1106 | 1106 | $paymentTermId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); |
| 1107 | 1107 | } |
| 1108 | - $object->cond_reglement_id = $paymentTermId; |
|
| 1108 | + $object->cond_reglement_id = $paymentTermId; |
|
| 1109 | 1109 | $paymentTypeId = GETPOSTINT('mode_reglement_id'); // can be set by default values on create page and not already in get or post variables |
| 1110 | 1110 | if (empty($paymentTypeId) && !GETPOSTISSET('mode_reglement_id')) { |
| 1111 | 1111 | $paymentTypeId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); |
| 1112 | 1112 | } |
| 1113 | - $object->mode_reglement_id = $paymentTypeId; |
|
| 1113 | + $object->mode_reglement_id = $paymentTypeId; |
|
| 1114 | 1114 | $object->barcode = GETPOST('barcode', 'alphanohtml'); |
| 1115 | 1115 | $object->idprof1 = GETPOST('idprof1', 'alphanohtml'); |
| 1116 | 1116 | $object->idprof2 = GETPOST('idprof2', 'alphanohtml'); |
@@ -1123,7 +1123,7 @@ discard block |
||
| 1123 | 1123 | $object->civility_id = GETPOST('civility_id', 'alpha'); |
| 1124 | 1124 | |
| 1125 | 1125 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
| 1126 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 1126 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 1127 | 1127 | $object->status = GETPOSTINT('status'); |
| 1128 | 1128 | |
| 1129 | 1129 | //Local Taxes |
@@ -1139,7 +1139,7 @@ discard block |
||
| 1139 | 1139 | $object->default_lang = GETPOST('default_lang'); |
| 1140 | 1140 | |
| 1141 | 1141 | if (GETPOSTISSET('accountancy_code_sell')) { |
| 1142 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 1142 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 1143 | 1143 | |
| 1144 | 1144 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
| 1145 | 1145 | $object->accountancy_code_sell = ''; |
@@ -1148,7 +1148,7 @@ discard block |
||
| 1148 | 1148 | } |
| 1149 | 1149 | } |
| 1150 | 1150 | if (GETPOSTISSET('accountancy_code_buy')) { |
| 1151 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 1151 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 1152 | 1152 | |
| 1153 | 1153 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
| 1154 | 1154 | $object->accountancy_code_buy = ''; |
@@ -1273,7 +1273,7 @@ discard block |
||
| 1273 | 1273 | |
| 1274 | 1274 | print '<script type="text/javascript">'; |
| 1275 | 1275 | print '$(document).ready(function () { |
| 1276 | - var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1') . '; |
|
| 1276 | + var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1').'; |
|
| 1277 | 1277 | |
| 1278 | 1278 | init_customer_categ(); |
| 1279 | 1279 | $("#customerprospect").change(function() { |
@@ -1346,7 +1346,7 @@ discard block |
||
| 1346 | 1346 | print '</td><td'.(getDolGlobalString('SOCIETE_USEPREFIX') ? '' : ' colspan="3"').'>'; |
| 1347 | 1347 | |
| 1348 | 1348 | print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus">'; |
| 1349 | - print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages |
|
| 1349 | + print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages |
|
| 1350 | 1350 | // This implementation of the feature to search already existing company has been disabled. It must be implemented by keeping the "input text" and we must call the search ajax societe/ajax/ajaxcompanies.php |
| 1351 | 1351 | // on a keydown of the input. We should show data about a duplicate found if we found less than 5 answers into a div under the input. |
| 1352 | 1352 | /* |
@@ -1718,7 +1718,7 @@ discard block |
||
| 1718 | 1718 | print '<td></td>'; |
| 1719 | 1719 | print '<td></td>'; |
| 1720 | 1720 | } |
| 1721 | - print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email') .' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>'; |
|
| 1721 | + print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>'; |
|
| 1722 | 1722 | print '<td class="individualline" '.(($conf->browser->layout == 'phone') || !isModEnabled('mailing') ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($object->no_email) ? 0 : 1)), 1, false, 1).'</td>'; |
| 1723 | 1723 | print '</tr>'; |
| 1724 | 1724 | } |
@@ -1766,7 +1766,7 @@ discard block |
||
| 1766 | 1766 | // Vat is used |
| 1767 | 1767 | print '<tr><td><label for="assujtva_value">'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</label></td>'; |
| 1768 | 1768 | print '<td>'; |
| 1769 | - print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . (GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"') . ' value="1">'; // Assujeti par default en creation |
|
| 1769 | + print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.(GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"').' value="1">'; // Assujeti par default en creation |
|
| 1770 | 1770 | print '</td>'; |
| 1771 | 1771 | if ($conf->browser->layout == 'phone') { |
| 1772 | 1772 | print '</tr><tr>'; |
@@ -1807,7 +1807,7 @@ discard block |
||
| 1807 | 1807 | |
| 1808 | 1808 | // VAT reverse charge by default |
| 1809 | 1809 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
| 1810 | - print '<tr><td><label for="vat_reverse_charge">' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</label></td><td colspan="3">'; |
|
| 1810 | + print '<tr><td><label for="vat_reverse_charge">'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</label></td><td colspan="3">'; |
|
| 1811 | 1811 | print '<input type="checkbox" name="vat_reverse_charge" id="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>'; |
| 1812 | 1812 | print '</td></tr>'; |
| 1813 | 1813 | } |
@@ -1816,21 +1816,21 @@ discard block |
||
| 1816 | 1816 | //TODO: Place into a function to control showing by country or study better option |
| 1817 | 1817 | if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { |
| 1818 | 1818 | print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td>'; |
| 1819 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">'; |
|
| 1819 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">'; |
|
| 1820 | 1820 | print '</td>'; |
| 1821 | 1821 | if ($conf->browser->layout == 'phone') { |
| 1822 | 1822 | print '</tr><tr>'; |
| 1823 | 1823 | } |
| 1824 | 1824 | print '<td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td>'; |
| 1825 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">'; |
|
| 1825 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">'; |
|
| 1826 | 1826 | print '</td></tr>'; |
| 1827 | 1827 | } elseif ($mysoc->localtax1_assuj == "1") { |
| 1828 | 1828 | print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td colspan="3">'; |
| 1829 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">'; |
|
| 1829 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">'; |
|
| 1830 | 1830 | print '</td></tr>'; |
| 1831 | 1831 | } elseif ($mysoc->localtax2_assuj == "1") { |
| 1832 | 1832 | print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td colspan="3">'; |
| 1833 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">'; |
|
| 1833 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">'; |
|
| 1834 | 1834 | print '</td></tr>'; |
| 1835 | 1835 | } |
| 1836 | 1836 | |
@@ -2098,10 +2098,10 @@ discard block |
||
| 2098 | 2098 | } |
| 2099 | 2099 | |
| 2100 | 2100 | $object->phone = GETPOST('phone', 'alpha'); |
| 2101 | - $object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha'); |
|
| 2101 | + $object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha'); |
|
| 2102 | 2102 | $object->fax = GETPOST('fax', 'alpha'); |
| 2103 | 2103 | $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); |
| 2104 | - $object->no_email = GETPOSTINT("no_email"); |
|
| 2104 | + $object->no_email = GETPOSTINT("no_email"); |
|
| 2105 | 2105 | $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); |
| 2106 | 2106 | $object->capital = GETPOSTFLOAT('capital'); |
| 2107 | 2107 | $object->idprof1 = GETPOST('idprof1', 'alphanohtml'); |
@@ -2117,16 +2117,16 @@ discard block |
||
| 2117 | 2117 | $object->default_lang = GETPOST('default_lang', 'alpha'); |
| 2118 | 2118 | |
| 2119 | 2119 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
| 2120 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 2120 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 2121 | 2121 | $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); |
| 2122 | - $object->status = GETPOSTINT('status'); |
|
| 2122 | + $object->status = GETPOSTINT('status'); |
|
| 2123 | 2123 | |
| 2124 | 2124 | // Webservices url/key |
| 2125 | 2125 | $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); |
| 2126 | 2126 | $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); |
| 2127 | 2127 | |
| 2128 | 2128 | if (GETPOSTISSET('accountancy_code_sell')) { |
| 2129 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 2129 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 2130 | 2130 | |
| 2131 | 2131 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
| 2132 | 2132 | $object->accountancy_code_sell = ''; |
@@ -2135,7 +2135,7 @@ discard block |
||
| 2135 | 2135 | } |
| 2136 | 2136 | } |
| 2137 | 2137 | if (GETPOSTISSET('accountancy_code_buy')) { |
| 2138 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 2138 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 2139 | 2139 | |
| 2140 | 2140 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
| 2141 | 2141 | $object->accountancy_code_buy = ''; |
@@ -2217,7 +2217,7 @@ discard block |
||
| 2217 | 2217 | } |
| 2218 | 2218 | }); |
| 2219 | 2219 | |
| 2220 | - var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . '; |
|
| 2220 | + var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0').'; |
|
| 2221 | 2221 | |
| 2222 | 2222 | init_customer_categ(); |
| 2223 | 2223 | $("#customerprospect").change(function() { |
@@ -2596,14 +2596,14 @@ discard block |
||
| 2596 | 2596 | |
| 2597 | 2597 | // VAT is used |
| 2598 | 2598 | print '<tr><td>'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</td><td colspan="3">'; |
| 2599 | - print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . ($object->tva_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
| 2599 | + print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.($object->tva_assuj ? 'checked="checked"' : '').' value="1">'; |
|
| 2600 | 2600 | print '</td></tr>'; |
| 2601 | 2601 | |
| 2602 | 2602 | // Local Taxes |
| 2603 | 2603 | //TODO: Place into a function to control showing by country or study better option |
| 2604 | 2604 | if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { |
| 2605 | 2605 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td>'; |
| 2606 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
| 2606 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">'; |
|
| 2607 | 2607 | if (!isOnlyOneLocalTax(1)) { |
| 2608 | 2608 | print '<span class="cblt1"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
| 2609 | 2609 | $formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1"); |
@@ -2612,7 +2612,7 @@ discard block |
||
| 2612 | 2612 | print '</td>'; |
| 2613 | 2613 | print '</tr><tr>'; |
| 2614 | 2614 | print '<td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td>'; |
| 2615 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1"></td></tr>'; |
|
| 2615 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1"></td></tr>'; |
|
| 2616 | 2616 | if (!isOnlyOneLocalTax(2)) { |
| 2617 | 2617 | print '<span class="cblt2"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
| 2618 | 2618 | $formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2"); |
@@ -2621,7 +2621,7 @@ discard block |
||
| 2621 | 2621 | print '</td></tr>'; |
| 2622 | 2622 | } elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") { |
| 2623 | 2623 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td colspan="3">'; |
| 2624 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
| 2624 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">'; |
|
| 2625 | 2625 | if (!isOnlyOneLocalTax(1)) { |
| 2626 | 2626 | print '<span class="cblt1"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
| 2627 | 2627 | $formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1"); |
@@ -2630,7 +2630,7 @@ discard block |
||
| 2630 | 2630 | print '</td></tr>'; |
| 2631 | 2631 | } elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") { |
| 2632 | 2632 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td colspan="3">'; |
| 2633 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
| 2633 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1">'; |
|
| 2634 | 2634 | if (!isOnlyOneLocalTax(2)) { |
| 2635 | 2635 | print '<span class="cblt2"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
| 2636 | 2636 | $formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2"); |
@@ -2641,7 +2641,7 @@ discard block |
||
| 2641 | 2641 | |
| 2642 | 2642 | // VAT reverse charge by default |
| 2643 | 2643 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
| 2644 | - print '<tr><td>' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</td><td colspan="3">'; |
|
| 2644 | + print '<tr><td>'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</td><td colspan="3">'; |
|
| 2645 | 2645 | print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>'; |
| 2646 | 2646 | print '</td></tr>'; |
| 2647 | 2647 | } |
@@ -2810,7 +2810,7 @@ discard block |
||
| 2810 | 2810 | $maxfilesizearray = getMaxFileSizeArray(); |
| 2811 | 2811 | $maxmin = $maxfilesizearray['maxmin']; |
| 2812 | 2812 | if ($maxmin > 0) { |
| 2813 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 2813 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 2814 | 2814 | } |
| 2815 | 2815 | print '<input type="file" class="flat" name="photo" id="photoinput">'; |
| 2816 | 2816 | print '</td></tr>'; |
@@ -3046,7 +3046,7 @@ discard block |
||
| 3046 | 3046 | print '<tr><td>'; |
| 3047 | 3047 | print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc')); |
| 3048 | 3048 | print '</td><td>'; |
| 3049 | - print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>'; |
|
| 3049 | + print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>'; |
|
| 3050 | 3050 | print '</td>'; |
| 3051 | 3051 | print '</tr>'; |
| 3052 | 3052 | } |
@@ -26,9 +26,9 @@ discard block |
||
| 26 | 26 | * \brief File of class with all html predefined components for WebPortal |
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | -require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 30 | -require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php'; |
|
| 31 | -require_once DOL_DOCUMENT_ROOT . '/webportal/class/html.formwebportal.class.php'; |
|
| 29 | +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 30 | +require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; |
|
| 31 | +require_once DOL_DOCUMENT_ROOT.'/webportal/class/html.formwebportal.class.php'; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Class to manage generation of HTML components |
@@ -134,10 +134,10 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | // load module libraries |
| 137 | - dol_include_once('/webportal/class/webportal' . $elementEn . '.class.php'); |
|
| 137 | + dol_include_once('/webportal/class/webportal'.$elementEn.'.class.php'); |
|
| 138 | 138 | |
| 139 | 139 | // Initialize a technical objects |
| 140 | - $objectclass = 'WebPortal' . ucfirst($elementEn); |
|
| 140 | + $objectclass = 'WebPortal'.ucfirst($elementEn); |
|
| 141 | 141 | $object = new $objectclass($this->db); |
| 142 | 142 | |
| 143 | 143 | // set form list |
@@ -147,14 +147,14 @@ discard block |
||
| 147 | 147 | $this->sortfield = GETPOST('sortfield', 'aZ09comma'); |
| 148 | 148 | $this->sortorder = GETPOST('sortorder', 'aZ09comma'); |
| 149 | 149 | $this->page = GETPOSTISSET('page') ? GETPOSTINT('page') : 1; |
| 150 | - $this->titleKey = $objectclass . 'ListTitle'; |
|
| 150 | + $this->titleKey = $objectclass.'ListTitle'; |
|
| 151 | 151 | |
| 152 | 152 | // Initialize array of search criteria |
| 153 | 153 | //$search_all = GETPOST('search_all', 'alphanohtml'); |
| 154 | 154 | $search = array(); |
| 155 | 155 | foreach ($object->fields as $key => $val) { |
| 156 | - if (GETPOST('search_' . $key, 'alpha') !== '') { |
|
| 157 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
| 156 | + if (GETPOST('search_'.$key, 'alpha') !== '') { |
|
| 157 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
| 158 | 158 | } |
| 159 | 159 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 160 | 160 | /* Fix: this is not compatible with multilangage date format, replaced with dolibarr method |
@@ -176,12 +176,12 @@ discard block |
||
| 176 | 176 | $search[$key . '_dtend'] = dol_mktime(23, 59, 59, $dateEndMonth, $dateEndDay, $dateEndYear); |
| 177 | 177 | } |
| 178 | 178 | */ |
| 179 | - $search[$key . '_dtstartmonth'] = GETPOSTINT('search_' . $key . '_dtstartmonth'); |
|
| 180 | - $search[$key . '_dtstartday'] = GETPOSTINT('search_' . $key . '_dtstartday'); |
|
| 181 | - $search[$key . '_dtstartyear'] = GETPOSTINT('search_' . $key . '_dtstartyear'); |
|
| 182 | - $search[$key . '_dtendmonth'] = GETPOSTINT('search_' . $key . '_dtendmonth'); |
|
| 183 | - $search[$key . '_dtendday'] = GETPOSTINT('search_' . $key . '_dtendday'); |
|
| 184 | - $search[$key . '_dtendyear'] = GETPOSTINT('search_' . $key . '_dtendyear'); |
|
| 179 | + $search[$key.'_dtstartmonth'] = GETPOSTINT('search_'.$key.'_dtstartmonth'); |
|
| 180 | + $search[$key.'_dtstartday'] = GETPOSTINT('search_'.$key.'_dtstartday'); |
|
| 181 | + $search[$key.'_dtstartyear'] = GETPOSTINT('search_'.$key.'_dtstartyear'); |
|
| 182 | + $search[$key.'_dtendmonth'] = GETPOSTINT('search_'.$key.'_dtendmonth'); |
|
| 183 | + $search[$key.'_dtendday'] = GETPOSTINT('search_'.$key.'_dtendday'); |
|
| 184 | + $search[$key.'_dtendyear'] = GETPOSTINT('search_'.$key.'_dtendyear'); |
|
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 | $this->search = $search; |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | // If $val['visible']==0, then we never show the field |
| 196 | 196 | if (!empty($val['visible'])) { |
| 197 | 197 | $visible = (int) dol_eval((string) $val['visible'], 1); |
| 198 | - $arrayfields['t.' . $key] = array( |
|
| 198 | + $arrayfields['t.'.$key] = array( |
|
| 199 | 199 | 'label' => $val['label'], |
| 200 | 200 | 'checked' => (($visible < 0) ? 0 : 1), |
| 201 | 201 | 'enabled' => (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), |
@@ -235,12 +235,12 @@ discard block |
||
| 235 | 235 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 236 | 236 | //$search[$key . '_dtstart'] = ''; |
| 237 | 237 | //$search[$key . '_dtend'] = ''; |
| 238 | - $search[$key . '_dtstartmonth'] = ''; |
|
| 239 | - $search[$key . '_dtendmonth'] = ''; |
|
| 240 | - $search[$key . '_dtstartday'] = ''; |
|
| 241 | - $search[$key . '_dtendday'] = ''; |
|
| 242 | - $search[$key . '_dtstartyear'] = ''; |
|
| 243 | - $search[$key . '_dtendyear'] = ''; |
|
| 238 | + $search[$key.'_dtstartmonth'] = ''; |
|
| 239 | + $search[$key.'_dtendmonth'] = ''; |
|
| 240 | + $search[$key.'_dtstartday'] = ''; |
|
| 241 | + $search[$key.'_dtendday'] = ''; |
|
| 242 | + $search[$key.'_dtstartyear'] = ''; |
|
| 243 | + $search[$key.'_dtendyear'] = ''; |
|
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | $this->search = $search; |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | $offset = $limit * ($page - 1); |
| 297 | 297 | if (!$sortfield) { |
| 298 | 298 | reset($object->fields); // Reset is required to avoid key() to return null. |
| 299 | - $sortfield = 't.' . key($object->fields); // Set here default search field. By default 1st field in definition. |
|
| 299 | + $sortfield = 't.'.key($object->fields); // Set here default search field. By default 1st field in definition. |
|
| 300 | 300 | } |
| 301 | 301 | if (!$sortorder) { |
| 302 | 302 | $sortorder = 'DESC'; |
@@ -317,18 +317,18 @@ discard block |
||
| 317 | 317 | |
| 318 | 318 | $sqlfields = $sql; // $sql fields to remove for count total |
| 319 | 319 | |
| 320 | - $sql .= " FROM " . $this->db->prefix() . $object->table_element . " as t"; |
|
| 320 | + $sql .= " FROM ".$this->db->prefix().$object->table_element." as t"; |
|
| 321 | 321 | // Add table from hooks |
| 322 | 322 | $parameters = array(); |
| 323 | 323 | $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 324 | 324 | $sql .= $hookmanager->resPrint; |
| 325 | 325 | if ($object->ismultientitymanaged == 1) { |
| 326 | - $sql .= " WHERE t.entity IN (" . getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)) . ")"; |
|
| 326 | + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; |
|
| 327 | 327 | } else { |
| 328 | 328 | $sql .= " WHERE 1 = 1"; |
| 329 | 329 | } |
| 330 | 330 | // filter on logged third-party |
| 331 | - $sql .= " AND t.fk_soc = " . ((int) $socid); |
|
| 331 | + $sql .= " AND t.fk_soc = ".((int) $socid); |
|
| 332 | 332 | // discard record with status draft |
| 333 | 333 | $sql .= " AND t.fk_statut <> 0"; |
| 334 | 334 | |
@@ -345,17 +345,17 @@ discard block |
||
| 345 | 345 | $mode_search = 2; |
| 346 | 346 | } |
| 347 | 347 | if ($search[$key] != '') { |
| 348 | - $sql .= natural_search("t." . $this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search)); |
|
| 348 | + $sql .= natural_search("t.".$this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search)); |
|
| 349 | 349 | } |
| 350 | 350 | } else { |
| 351 | 351 | if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { |
| 352 | 352 | $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); |
| 353 | 353 | if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { |
| 354 | 354 | if (preg_match('/_dtstart$/', $key)) { |
| 355 | - $sql .= " AND t." . $this->db->escape($columnName) . " >= '" . $this->db->idate((int) $search[$key]) . "'"; |
|
| 355 | + $sql .= " AND t.".$this->db->escape($columnName)." >= '".$this->db->idate((int) $search[$key])."'"; |
|
| 356 | 356 | } |
| 357 | 357 | if (preg_match('/_dtend$/', $key)) { |
| 358 | - $sql .= " AND t." . $this->db->escape($columnName) . " <= '" . $this->db->idate((int) $search[$key]) . "'"; |
|
| 358 | + $sql .= " AND t.".$this->db->escape($columnName)." <= '".$this->db->idate((int) $search[$key])."'"; |
|
| 359 | 359 | } |
| 360 | 360 | } |
| 361 | 361 | } |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | $nbtotalofrecords = 0; |
| 374 | 374 | if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { |
| 375 | 375 | /* The fast and low memory method to get and count full list converts the sql into a sql count */ |
| 376 | - $sqlforcount = preg_replace('/^' . preg_quote($sqlfields, '/') . '/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); |
|
| 376 | + $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); |
|
| 377 | 377 | $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); |
| 378 | 378 | $resql = $this->db->query($sqlforcount); |
| 379 | 379 | if ($resql) { |
@@ -426,21 +426,21 @@ discard block |
||
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | $param = ''; |
| 429 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
| 430 | - $param .= '&limit=' . $limit; |
|
| 429 | + $param .= '&contextpage='.urlencode($contextpage); |
|
| 430 | + $param .= '&limit='.$limit; |
|
| 431 | 431 | foreach ($search as $key => $val) { |
| 432 | 432 | if (is_array($search[$key])) { |
| 433 | 433 | foreach ($search[$key] as $skey) { |
| 434 | 434 | if ($skey != '') { |
| 435 | - $param .= '&search_' . $key . '[]=' . urlencode($skey); |
|
| 435 | + $param .= '&search_'.$key.'[]='.urlencode($skey); |
|
| 436 | 436 | } |
| 437 | 437 | } |
| 438 | 438 | } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { |
| 439 | - $param .= '&search_' . $key . 'month=' . (GETPOSTINT('search_' . $key . 'month')); |
|
| 440 | - $param .= '&search_' . $key . 'day=' . (GETPOSTINT('search_' . $key . 'day')); |
|
| 441 | - $param .= '&search_' . $key . 'year=' . (GETPOSTINT('search_' . $key . 'year')); |
|
| 439 | + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); |
|
| 440 | + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); |
|
| 441 | + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); |
|
| 442 | 442 | } elseif ($search[$key] != '') { |
| 443 | - $param .= '&search_' . $key . '=' . urlencode($search[$key]); |
|
| 443 | + $param .= '&search_'.$key.'='.urlencode($search[$key]); |
|
| 444 | 444 | } |
| 445 | 445 | } |
| 446 | 446 | // Add $param from hooks |
@@ -449,29 +449,29 @@ discard block |
||
| 449 | 449 | $param .= $hookmanager->resPrint; |
| 450 | 450 | |
| 451 | 451 | $url_file = $context->getControllerUrl($context->controller); |
| 452 | - $html .= '<form method="POST" id="searchFormList" action="' . $url_file . '">' . "\n"; |
|
| 452 | + $html .= '<form method="POST" id="searchFormList" action="'.$url_file.'">'."\n"; |
|
| 453 | 453 | $html .= $context->getFormToken(); |
| 454 | 454 | $html .= '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
| 455 | 455 | $html .= '<input type="hidden" name="action" value="list">'; |
| 456 | - $html .= '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
| 457 | - $html .= '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
| 458 | - $html .= '<input type="hidden" name="page" value="' . $page . '">'; |
|
| 459 | - $html .= '<input type="hidden" name="contextpage" value="' . $contextpage . '">'; |
|
| 456 | + $html .= '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
| 457 | + $html .= '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
| 458 | + $html .= '<input type="hidden" name="page" value="'.$page.'">'; |
|
| 459 | + $html .= '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; |
|
| 460 | 460 | |
| 461 | 461 | // pagination |
| 462 | - $pagination_param = $param . '&sortfield=' . $sortfield . '&sortorder=' . $sortorder; |
|
| 463 | - $html .= '<nav id="webportal-' . $elementEn . '-pagination">'; |
|
| 462 | + $pagination_param = $param.'&sortfield='.$sortfield.'&sortorder='.$sortorder; |
|
| 463 | + $html .= '<nav id="webportal-'.$elementEn.'-pagination">'; |
|
| 464 | 464 | $html .= '<ul>'; |
| 465 | - $html .= '<li><strong>' . $langs->trans($titleKey) . '</strong> (' . $nbtotalofrecords . ')</li>'; |
|
| 465 | + $html .= '<li><strong>'.$langs->trans($titleKey).'</strong> ('.$nbtotalofrecords.')</li>'; |
|
| 466 | 466 | $html .= '</ul>'; |
| 467 | 467 | |
| 468 | 468 | /* Generate pagination list */ |
| 469 | - $html .= static::generatePageListNav($url_file . $pagination_param, $nbpages, $page); |
|
| 469 | + $html .= static::generatePageListNav($url_file.$pagination_param, $nbpages, $page); |
|
| 470 | 470 | |
| 471 | 471 | $html .= '</nav>'; |
| 472 | 472 | |
| 473 | 473 | // table with search filters and column titles |
| 474 | - $html .= '<table id="webportal-' . $elementEn . '-list" responsive="scroll" role="grid">'; |
|
| 474 | + $html .= '<table id="webportal-'.$elementEn.'-list" responsive="scroll" role="grid">'; |
|
| 475 | 475 | // title and desc for table |
| 476 | 476 | //if ($titleKey != '') { |
| 477 | 477 | // $html .= '<caption id="table-collapse-responsive">'; |
@@ -495,22 +495,22 @@ discard block |
||
| 495 | 495 | $html .= '</td>'; |
| 496 | 496 | // } |
| 497 | 497 | foreach ($object->fields as $key => $val) { |
| 498 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
| 499 | - $html .= '<td data-label="' . $arrayfields['t.' . $key]['label'] . '" data-col="'.dol_escape_htmltag($key).'" >'; |
|
| 498 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
| 499 | + $html .= '<td data-label="'.$arrayfields['t.'.$key]['label'].'" data-col="'.dol_escape_htmltag($key).'" >'; |
|
| 500 | 500 | if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { |
| 501 | - $html .= $this->form->selectarray('search_' . $key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', ''); |
|
| 501 | + $html .= $this->form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', ''); |
|
| 502 | 502 | } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 503 | - $postDateStart = dol_mktime(0, 0, 0, (int) $search[$key . '_dtstartmonth'], (int) $search[$key . '_dtstartday'], (int) $search[$key . '_dtstartyear']); |
|
| 504 | - $postDateEnd = dol_mktime(0, 0, 0, (int) $search[$key . '_dtendmonth'], (int) $search[$key . '_dtendday'], (int) $search[$key . '_dtendyear']); |
|
| 503 | + $postDateStart = dol_mktime(0, 0, 0, (int) $search[$key.'_dtstartmonth'], (int) $search[$key.'_dtstartday'], (int) $search[$key.'_dtstartyear']); |
|
| 504 | + $postDateEnd = dol_mktime(0, 0, 0, (int) $search[$key.'_dtendmonth'], (int) $search[$key.'_dtendday'], (int) $search[$key.'_dtendyear']); |
|
| 505 | 505 | |
| 506 | 506 | $html .= '<div class="grid width150">'; |
| 507 | - $html .= $this->form->inputDate('search_' . $key . '_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From')); |
|
| 507 | + $html .= $this->form->inputDate('search_'.$key.'_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From')); |
|
| 508 | 508 | $html .= '</div>'; |
| 509 | 509 | $html .= '<div class="grid width150">'; |
| 510 | - $html .= $this->form->inputDate('search_' . $key . '_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to')); |
|
| 510 | + $html .= $this->form->inputDate('search_'.$key.'_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to')); |
|
| 511 | 511 | $html .= '</div>'; |
| 512 | 512 | } else { |
| 513 | - $html .= '<input type="text" name="search_' . $key . '" value="' . dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '') . '">'; |
|
| 513 | + $html .= '<input type="text" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">'; |
|
| 514 | 514 | } |
| 515 | 515 | $html .= '</td>'; |
| 516 | 516 | } |
@@ -521,18 +521,18 @@ discard block |
||
| 521 | 521 | $html .= $hookmanager->resPrint; |
| 522 | 522 | // Remain to pay |
| 523 | 523 | if (array_key_exists('remain_to_pay', $arrayfields) && !empty($arrayfields['remain_to_pay']['checked'])) { |
| 524 | - $html .= '<td data-label="' . $arrayfields['remain_to_pay']['label'] . '">'; |
|
| 524 | + $html .= '<td data-label="'.$arrayfields['remain_to_pay']['label'].'">'; |
|
| 525 | 525 | $html .= '</td>'; |
| 526 | 526 | } |
| 527 | 527 | // Download link |
| 528 | 528 | if (array_key_exists('download_link', $arrayfields) && !empty($arrayfields['download_link']['checked'])) { |
| 529 | - $html .= '<td data-label="' . $arrayfields['download_link']['label'] . '">'; |
|
| 529 | + $html .= '<td data-label="'.$arrayfields['download_link']['label'].'">'; |
|
| 530 | 530 | $html .= '</td>'; |
| 531 | 531 | } |
| 532 | 532 | // Signature link |
| 533 | 533 | if ($elementEn == "propal" && getDolGlobalString("PROPOSAL_ALLOW_ONLINESIGN") != 0) { |
| 534 | 534 | if (array_key_exists('signature_link', $arrayfields) && !empty($arrayfields['signature_link']['checked'])) { |
| 535 | - $html .= '<td data-label="' . $arrayfields['signature_link']['label'] . '">'; |
|
| 535 | + $html .= '<td data-label="'.$arrayfields['signature_link']['label'].'">'; |
|
| 536 | 536 | $html .= '</td>'; |
| 537 | 537 | } |
| 538 | 538 | } |
@@ -550,16 +550,16 @@ discard block |
||
| 550 | 550 | $totalarray['nbfield']++; |
| 551 | 551 | // } |
| 552 | 552 | foreach ($object->fields as $key => $val) { |
| 553 | - $tableKey = 't.' . $key; |
|
| 553 | + $tableKey = 't.'.$key; |
|
| 554 | 554 | if (!empty($arrayfields[$tableKey]['checked'])) { |
| 555 | 555 | $tableOrder = ''; |
| 556 | 556 | if (array_key_exists($tableKey, $sortList)) { |
| 557 | 557 | $tableOrder = strtolower($sortList[$tableKey]); |
| 558 | 558 | } |
| 559 | - $url_param = $url_file . '&sortfield=' . $tableKey . '&sortorder=' . ($tableOrder == 'desc' ? 'asc' : 'desc') . $param; |
|
| 560 | - $html .= '<th data-col="'.dol_escape_htmltag($key).'" scope="col"' . ($tableOrder != '' ? ' table-order="' . $tableOrder . '"' : '') . '>'; |
|
| 561 | - $html .= '<a href="' . $url_param . '">'; |
|
| 562 | - $html .= $langs->trans($arrayfields['t.' . $key]['label']); |
|
| 559 | + $url_param = $url_file.'&sortfield='.$tableKey.'&sortorder='.($tableOrder == 'desc' ? 'asc' : 'desc').$param; |
|
| 560 | + $html .= '<th data-col="'.dol_escape_htmltag($key).'" scope="col"'.($tableOrder != '' ? ' table-order="'.$tableOrder.'"' : '').'>'; |
|
| 561 | + $html .= '<a href="'.$url_param.'">'; |
|
| 562 | + $html .= $langs->trans($arrayfields['t.'.$key]['label']); |
|
| 563 | 563 | $html .= '</a>'; |
| 564 | 564 | $html .= '</th>'; |
| 565 | 565 | $totalarray['nbfield']++; |
@@ -643,13 +643,13 @@ discard block |
||
| 643 | 643 | $remaintopay = 0; |
| 644 | 644 | } |
| 645 | 645 | if ($object->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1 && $discount) { |
| 646 | - $remaincreditnote = $discount->getAvailableDiscounts($companyStatic, null, 'rc.fk_facture_source=' . $object->id); |
|
| 646 | + $remaincreditnote = $discount->getAvailableDiscounts($companyStatic, null, 'rc.fk_facture_source='.$object->id); |
|
| 647 | 647 | $remaintopay = -$remaincreditnote; |
| 648 | 648 | } |
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | // Show line of result |
| 652 | - $html .= '<tr data-rowid="' . $object->id . '">'; |
|
| 652 | + $html .= '<tr data-rowid="'.$object->id.'">'; |
|
| 653 | 653 | // if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
| 654 | 654 | $html .= '<td class="nowraponall">'; |
| 655 | 655 | $html .= '</td>'; |
@@ -658,8 +658,8 @@ discard block |
||
| 658 | 658 | } |
| 659 | 659 | // } |
| 660 | 660 | foreach ($object->fields as $key => $val) { |
| 661 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
| 662 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['t.' . $key]['label'] . '">'; |
|
| 661 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
| 662 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['t.'.$key]['label'].'">'; |
|
| 663 | 663 | if ($key == 'status' || $key == 'fk_statut') { |
| 664 | 664 | if ($elementEn == 'invoice') { |
| 665 | 665 | // specific to get invoice status (depends on payment) |
@@ -680,15 +680,15 @@ discard block |
||
| 680 | 680 | } |
| 681 | 681 | if (!empty($val['isameasure']) && $val['isameasure'] == 1) { |
| 682 | 682 | if (!$i) { |
| 683 | - $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; |
|
| 683 | + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; |
|
| 684 | 684 | } |
| 685 | 685 | if (!isset($totalarray['val'])) { |
| 686 | 686 | $totalarray['val'] = array(); |
| 687 | 687 | } |
| 688 | - if (!isset($totalarray['val']['t.' . $key])) { |
|
| 689 | - $totalarray['val']['t.' . $key] = 0; |
|
| 688 | + if (!isset($totalarray['val']['t.'.$key])) { |
|
| 689 | + $totalarray['val']['t.'.$key] = 0; |
|
| 690 | 690 | } |
| 691 | - $totalarray['val']['t.' . $key] += $object->$key; |
|
| 691 | + $totalarray['val']['t.'.$key] += $object->$key; |
|
| 692 | 692 | } |
| 693 | 693 | } |
| 694 | 694 | } |
@@ -705,9 +705,9 @@ discard block |
||
| 705 | 705 | // Download link |
| 706 | 706 | if (array_key_exists('download_link', $arrayfields) && !empty($arrayfields['download_link']['checked'])) { |
| 707 | 707 | $element = $object->element; |
| 708 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['download_link']['label'] . '">'; |
|
| 708 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['download_link']['label'].'">'; |
|
| 709 | 709 | $filename = dol_sanitizeFileName($obj->ref); |
| 710 | - $filedir = $conf->{$element}->multidir_output[$obj->element_entity] . '/' . dol_sanitizeFileName($obj->ref); |
|
| 710 | + $filedir = $conf->{$element}->multidir_output[$obj->element_entity].'/'.dol_sanitizeFileName($obj->ref); |
|
| 711 | 711 | $html .= $this->form->getDocumentsLink($element, $filename, $filedir); |
| 712 | 712 | $html .= '</td>'; |
| 713 | 713 | if (!$i) { |
@@ -718,7 +718,7 @@ discard block |
||
| 718 | 718 | if ($elementEn == "propal" && getDolGlobalString("PROPOSAL_ALLOW_ONLINESIGN") != 0) { |
| 719 | 719 | '@phan-var-force Propal $object'; |
| 720 | 720 | if (!empty($arrayfields['signature_link']['checked'])) { |
| 721 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['signature_link']['label'] . '">'; |
|
| 721 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['signature_link']['label'].'">'; |
|
| 722 | 722 | if ($object->fk_statut == Propal::STATUS_VALIDATED) { |
| 723 | 723 | $html .= $this->form->getSignatureLink('proposal', $object); |
| 724 | 724 | } |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | $html .= '</td>'; |
| 758 | 758 | } else { |
| 759 | 759 | if ($i == 1) { |
| 760 | - $html .= '<td>' . $langs->trans("Total") . '</td>'; |
|
| 760 | + $html .= '<td>'.$langs->trans("Total").'</td>'; |
|
| 761 | 761 | } else { |
| 762 | 762 | $html .= '<td></td>'; |
| 763 | 763 | } |
@@ -774,7 +774,7 @@ discard block |
||
| 774 | 774 | $colspan++; |
| 775 | 775 | } |
| 776 | 776 | } |
| 777 | - $html .= '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
| 777 | + $html .= '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
| 778 | 778 | } |
| 779 | 779 | |
| 780 | 780 | $html .= '</tbody>'; |
@@ -814,7 +814,7 @@ discard block |
||
| 814 | 814 | $html = '<ul class="pages-nav-list">'; |
| 815 | 815 | |
| 816 | 816 | if ($currentPage > 1) { |
| 817 | - $html .= '<li><a class="pages-nav-list__icon --prev" aria-label="' . dol_escape_htmltag($langs->trans('AriaPrevPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage - 1) . '" ' . ($currentPage <= 1 ? ' disabled' : '') . '></a></li>'; |
|
| 817 | + $html .= '<li><a class="pages-nav-list__icon --prev" aria-label="'.dol_escape_htmltag($langs->trans('AriaPrevPage')).'" href="'.$url.$pSep.'page='.($currentPage - 1).'" '.($currentPage <= 1 ? ' disabled' : '').'></a></li>'; |
|
| 818 | 818 | } |
| 819 | 819 | |
| 820 | 820 | $maxPaginItem = min($nbPages, 5); |
@@ -822,21 +822,21 @@ discard block |
||
| 822 | 822 | $maxPageNum = min($nbPages, $currentPage + 3); |
| 823 | 823 | |
| 824 | 824 | if ($minPageNum > 1) { |
| 825 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage == 1 ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', 1)) . '" href="' . $url . $pSep . 'page=1" >1</a></li>'; |
|
| 825 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage == 1 ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', 1)).'" href="'.$url.$pSep.'page=1" >1</a></li>'; |
|
| 826 | 826 | $html .= '<li>…</li>'; |
| 827 | 827 | } |
| 828 | 828 | |
| 829 | 829 | for ($p = $minPageNum; $p <= $maxPageNum; $p++) { |
| 830 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage === $p ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $p)) . '" href="' . $url . $pSep . 'page=' . $p . '">' . $p . '</a></li>'; |
|
| 830 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage === $p ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $p)).'" href="'.$url.$pSep.'page='.$p.'">'.$p.'</a></li>'; |
|
| 831 | 831 | } |
| 832 | 832 | |
| 833 | 833 | if ($maxPaginItem < $nbPages) { |
| 834 | 834 | $html .= '<li>…</li>'; |
| 835 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage == $nbPages ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)) . '" href="' . $url . $pSep . 'page=' . $nbPages . '">' . $nbPages . '</a></li>'; |
|
| 835 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage == $nbPages ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)).'" href="'.$url.$pSep.'page='.$nbPages.'">'.$nbPages.'</a></li>'; |
|
| 836 | 836 | } |
| 837 | 837 | |
| 838 | 838 | if ($currentPage < $nbPages) { |
| 839 | - $html .= '<li><a class="pages-nav-list__icon --next" aria-label="' . dol_escape_htmltag($langs->trans('AriaNextPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage + 1) . '" ' . ($currentPage >= $nbPages ? ' disabled' : '') . '></a></li>'; |
|
| 839 | + $html .= '<li><a class="pages-nav-list__icon --next" aria-label="'.dol_escape_htmltag($langs->trans('AriaNextPage')).'" href="'.$url.$pSep.'page='.($currentPage + 1).'" '.($currentPage >= $nbPages ? ' disabled' : '').'></a></li>'; |
|
| 840 | 840 | } |
| 841 | 841 | |
| 842 | 842 | $html .= '</ul>'; |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * \brief File of class with all html predefined components for WebPortal |
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | -require_once DOL_DOCUMENT_ROOT . '/webportal/class/html.formwebportal.class.php'; |
|
| 28 | +require_once DOL_DOCUMENT_ROOT.'/webportal/class/html.formwebportal.class.php'; |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * Class to manage generation of HTML components |
@@ -151,15 +151,15 @@ discard block |
||
| 151 | 151 | global $hookmanager, $langs; |
| 152 | 152 | |
| 153 | 153 | $elementEnUpper = strtoupper($elementEn); |
| 154 | - $objectclass = 'WebPortal' . ucfirst($elementEn); |
|
| 154 | + $objectclass = 'WebPortal'.ucfirst($elementEn); |
|
| 155 | 155 | |
| 156 | - $elementCardAccess = getDolGlobalString('WEBPORTAL_' . $elementEnUpper . '_CARD_ACCESS', 'hidden'); |
|
| 156 | + $elementCardAccess = getDolGlobalString('WEBPORTAL_'.$elementEnUpper.'_CARD_ACCESS', 'hidden'); |
|
| 157 | 157 | if ($elementCardAccess == 'hidden' || $id <= 0) { |
| 158 | 158 | accessforbidden(); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | // load module libraries |
| 162 | - dol_include_once('/webportal/class/webportal' . $elementEn . '.class.php'); |
|
| 162 | + dol_include_once('/webportal/class/webportal'.$elementEn.'.class.php'); |
|
| 163 | 163 | |
| 164 | 164 | // Load translation files required by the page |
| 165 | 165 | $langs->loadLangs(array('website', 'other')); |
@@ -170,15 +170,15 @@ discard block |
||
| 170 | 170 | $action = GETPOST('action', 'aZ09'); |
| 171 | 171 | $confirm = GETPOST('confirm', 'alpha'); |
| 172 | 172 | $cancel = GETPOST('cancel', 'aZ09'); |
| 173 | - $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'webportal' . $elementEn . 'card'; // To manage different context of search |
|
| 174 | - $backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
| 175 | - $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 173 | + $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'webportal'.$elementEn.'card'; // To manage different context of search |
|
| 174 | + $backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
| 175 | + $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 176 | 176 | $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); |
| 177 | 177 | |
| 178 | 178 | // Initialize a technical objects |
| 179 | 179 | $object = new $objectclass($this->db); |
| 180 | 180 | //$extrafields = new ExtraFields($db); |
| 181 | - $hookmanager->initHooks(array('webportal' . $elementEn . 'card', 'globalcard')); // Note that conf->hooks_modules contains array |
|
| 181 | + $hookmanager->initHooks(array('webportal'.$elementEn.'card', 'globalcard')); // Note that conf->hooks_modules contains array |
|
| 182 | 182 | |
| 183 | 183 | // Fetch optionals attributes and labels |
| 184 | 184 | //$extrafields->fetch_name_optionals_label($object->table_element); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | // Load object |
| 192 | - include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. |
|
| 192 | + include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. |
|
| 193 | 193 | |
| 194 | 194 | // Security check (enable the most restrictive one) |
| 195 | 195 | if (!isModEnabled('webportal')) { |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $this->permissiontodelete = $permissiontodelete; |
| 214 | 214 | $this->permissionnote = $permissionnote; |
| 215 | 215 | $this->permissiondellink = $permissiondellink; |
| 216 | - $this->titleKey = $objectclass . 'CardTitle'; |
|
| 216 | + $this->titleKey = $objectclass.'CardTitle'; |
|
| 217 | 217 | $this->ref = $ref; |
| 218 | 218 | } |
| 219 | 219 | |
@@ -246,17 +246,17 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | if (empty($backtopage) || ($cancel && empty($id))) { |
| 248 | 248 | if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { |
| 249 | - $backtopage = $context->getControllerUrl($elementEn . 'card'); |
|
| 249 | + $backtopage = $context->getControllerUrl($elementEn.'card'); |
|
| 250 | 250 | } |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | // Action to cancel record |
| 254 | 254 | if ($cancel) { |
| 255 | 255 | if (!empty($backtopageforcancel)) { |
| 256 | - header("Location: " . $backtopageforcancel); |
|
| 256 | + header("Location: ".$backtopageforcancel); |
|
| 257 | 257 | exit; |
| 258 | 258 | } elseif (!empty($backtopage)) { |
| 259 | - header("Location: " . $backtopage); |
|
| 259 | + header("Location: ".$backtopage); |
|
| 260 | 260 | exit; |
| 261 | 261 | } |
| 262 | 262 | $action = ''; |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | foreach ($object->fields as $key => $val) { |
| 268 | 268 | // Check if field was submitted to be edited |
| 269 | 269 | if ($object->fields[$key]['type'] == 'duration') { |
| 270 | - if (!GETPOSTISSET($key . 'hour') || !GETPOSTISSET($key . 'min')) { |
|
| 270 | + if (!GETPOSTISSET($key.'hour') || !GETPOSTISSET($key.'min')) { |
|
| 271 | 271 | continue; // The field was not submitted to be saved |
| 272 | 272 | } |
| 273 | 273 | } elseif ($object->fields[$key]['type'] == 'boolean') { |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | $dateDay = (int) $dateArr[2]; |
| 319 | 319 | } |
| 320 | 320 | // extract time HH:ii:ss for hours, minutes and seconds |
| 321 | - $postTime = GETPOST($key . '_time', 'alphanohtml'); |
|
| 321 | + $postTime = GETPOST($key.'_time', 'alphanohtml'); |
|
| 322 | 322 | $timeArr = explode(':', $postTime); |
| 323 | 323 | $timeHours = 12; |
| 324 | 324 | $timeMinutes = 0; |
@@ -336,8 +336,8 @@ discard block |
||
| 336 | 336 | } |
| 337 | 337 | $value = dol_mktime($timeHours, $timeMinutes, $timeSeconds, $dateMonth, $dateDay, $dateYear); |
| 338 | 338 | } elseif ($object->fields[$key]['type'] == 'duration') { |
| 339 | - if (GETPOSTINT($key . 'hour') != '' || GETPOSTINT($key . 'min') != '') { |
|
| 340 | - $value = 60 * 60 * GETPOSTINT($key . 'hour') + 60 * GETPOSTINT($key . 'min'); |
|
| 339 | + if (GETPOSTINT($key.'hour') != '' || GETPOSTINT($key.'min') != '') { |
|
| 340 | + $value = 60 * 60 * GETPOSTINT($key.'hour') + 60 * GETPOSTINT($key.'min'); |
|
| 341 | 341 | } else { |
| 342 | 342 | $value = ''; |
| 343 | 343 | } |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; |
| 407 | 407 | $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', (string) $object->id, $urltogo); // New method to autoselect project after a New on another form object creation |
| 408 | 408 | if ($urltogo && empty($noback)) { |
| 409 | - header("Location: " . $urltogo); |
|
| 409 | + header("Location: ".$urltogo); |
|
| 410 | 410 | exit; |
| 411 | 411 | } |
| 412 | 412 | } else { |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | // main information - begin |
| 474 | 474 | $html .= '<div class="header-card-main-information inline-block valignmiddle">'; |
| 475 | 475 | // ref |
| 476 | - $html .= '<div><strong>' . $langs->trans("Ref").' : '.dol_escape_htmltag($object->ref) . '</strong></div>'; |
|
| 476 | + $html .= '<div><strong>'.$langs->trans("Ref").' : '.dol_escape_htmltag($object->ref).'</strong></div>'; |
|
| 477 | 477 | // full name |
| 478 | 478 | $fullname = ''; |
| 479 | 479 | if (method_exists($object, 'getFullName')) { |
@@ -484,11 +484,11 @@ discard block |
||
| 484 | 484 | '@phan-var-force Adherent $object'; |
| 485 | 485 | if ($object->morphy == 'mor' && !empty($object->societe)) { |
| 486 | 486 | $html .= dol_htmlentities((string) $object->societe); |
| 487 | - $html .= (!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''; |
|
| 487 | + $html .= (!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : ''; |
|
| 488 | 488 | } else { |
| 489 | - $html .= dol_htmlentities($fullname) . $addgendertxt; |
|
| 489 | + $html .= dol_htmlentities($fullname).$addgendertxt; |
|
| 490 | 490 | if (empty($object->fk_soc)) { |
| 491 | - $html .= (!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities((string) $object->societe) . ')' : ''; |
|
| 491 | + $html .= (!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities((string) $object->societe).')' : ''; |
|
| 492 | 492 | } |
| 493 | 493 | } |
| 494 | 494 | } else { |
@@ -578,23 +578,23 @@ discard block |
||
| 578 | 578 | |
| 579 | 579 | $value = $object->$key; |
| 580 | 580 | |
| 581 | - $html .= '<div class="grid field_' . $key . '">'; |
|
| 581 | + $html .= '<div class="grid field_'.$key.'">'; |
|
| 582 | 582 | |
| 583 | - $html .= '<div class="' . (empty($val['tdcss']) ? '' : $val['tdcss']) . ' fieldname_' . $key; |
|
| 583 | + $html .= '<div class="'.(empty($val['tdcss']) ? '' : $val['tdcss']).' fieldname_'.$key; |
|
| 584 | 584 | $html .= '">'; |
| 585 | 585 | $labeltoshow = ''; |
| 586 | - $labeltoshow .= '<strong>' . $langs->trans($val['label']) . '</strong>'; |
|
| 586 | + $labeltoshow .= '<strong>'.$langs->trans($val['label']).'</strong>'; |
|
| 587 | 587 | $html .= $labeltoshow; |
| 588 | 588 | $html .= '</div>'; |
| 589 | 589 | |
| 590 | - $html .= '<div class="valuefield fieldname_' . $key; |
|
| 590 | + $html .= '<div class="valuefield fieldname_'.$key; |
|
| 591 | 591 | if (!empty($val['cssview'])) { |
| 592 | - $html .= ' ' . $val['cssview']; |
|
| 592 | + $html .= ' '.$val['cssview']; |
|
| 593 | 593 | } |
| 594 | 594 | $html .= '">'; |
| 595 | 595 | if ($key == 'lang') { |
| 596 | 596 | $langs->load('languages'); |
| 597 | - $labellang = ($value ? $langs->trans('Language_' . $value) : ''); |
|
| 597 | + $labellang = ($value ? $langs->trans('Language_'.$value) : ''); |
|
| 598 | 598 | //$html .= picto_from_langcode($value, 'class="paddingrightonly saturatemedium opacitylow"'); |
| 599 | 599 | $html .= $labellang; |
| 600 | 600 | } else { |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | continue; // We don't want this field |
| 655 | 655 | } |
| 656 | 656 | |
| 657 | - $html .= '<div class="grid field_' . $key . '">'; |
|
| 657 | + $html .= '<div class="grid field_'.$key.'">'; |
|
| 658 | 658 | $html .= '<div class="titlefieldcreate'; |
| 659 | 659 | if (isset($val['notnull']) && $val['notnull'] > 0) { |
| 660 | 660 | $html .= ' required'; |
@@ -686,15 +686,15 @@ discard block |
||
| 686 | 686 | $value = GETPOSTISSET($key) ? GETPOST($key, $check) : $object->$key; |
| 687 | 687 | } elseif (in_array($val['type'], array('date', 'datetime'))) { |
| 688 | 688 | $isPostDate = GETPOSTISSET($key); |
| 689 | - $isPostTime = GETPOSTISSET($key . '_time'); |
|
| 689 | + $isPostTime = GETPOSTISSET($key.'_time'); |
|
| 690 | 690 | if ($isPostDate) { |
| 691 | 691 | $postDate = GETPOST($key, 'alphanohtml'); |
| 692 | 692 | if ($isPostTime) { |
| 693 | - $postTime = GETPOST($key . '_time', 'alphanohtml') . ':00'; |
|
| 693 | + $postTime = GETPOST($key.'_time', 'alphanohtml').':00'; |
|
| 694 | 694 | } else { |
| 695 | 695 | $postTime = '00:00:00'; |
| 696 | 696 | } |
| 697 | - $valueDateTimeStr = $postDate . ' ' . $postTime; |
|
| 697 | + $valueDateTimeStr = $postDate.' '.$postTime; |
|
| 698 | 698 | } else { |
| 699 | 699 | // format date timestamp to YYYY-MM-DD HH:ii:ss |
| 700 | 700 | $valueDateTimeStr = dol_print_date($object->$key, '%Y-%m-%d %H:%M:%S'); |
@@ -766,19 +766,19 @@ discard block |
||
| 766 | 766 | $html .= '<article>'; |
| 767 | 767 | //$html .= load_fiche_titre($title, '', 'object_'.$object->picto); |
| 768 | 768 | $html .= '<header>'; |
| 769 | - $html .= '<h2>' . $title . '</h2>'; |
|
| 769 | + $html .= '<h2>'.$title.'</h2>'; |
|
| 770 | 770 | $html .= '</header>'; |
| 771 | 771 | |
| 772 | 772 | $url_file = $context->getControllerUrl($context->controller, '', false); |
| 773 | - $html .= '<form method="POST" action="' . $url_file . '">'; |
|
| 773 | + $html .= '<form method="POST" action="'.$url_file.'">'; |
|
| 774 | 774 | $html .= $context->getFormToken(); |
| 775 | 775 | $html .= '<input type="hidden" name="action" value="update">'; |
| 776 | - $html .= '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 776 | + $html .= '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 777 | 777 | if ($backtopage) { |
| 778 | - $html .= '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 778 | + $html .= '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 779 | 779 | } |
| 780 | 780 | if ($backtopageforcancel) { |
| 781 | - $html .= '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
| 781 | + $html .= '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
| 782 | 782 | } |
| 783 | 783 | |
| 784 | 784 | //$html .= '<table>'."\n"; |
@@ -792,8 +792,8 @@ discard block |
||
| 792 | 792 | |
| 793 | 793 | // Save and Cancel buttons |
| 794 | 794 | $html .= '<div class="grid">'; |
| 795 | - $html .= '<div><input type="submit" name="save" role="button" value="' . dol_escape_htmltag($langs->trans('Save')) . '" /></div>'; |
|
| 796 | - $html .= '<div><input type="submit" name="cancel" role="button" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '" /></div>'; |
|
| 795 | + $html .= '<div><input type="submit" name="save" role="button" value="'.dol_escape_htmltag($langs->trans('Save')).'" /></div>'; |
|
| 796 | + $html .= '<div><input type="submit" name="cancel" role="button" value="'.dol_escape_htmltag($langs->trans('Cancel')).'" /></div>'; |
|
| 797 | 797 | $html .= '</div>'; |
| 798 | 798 | |
| 799 | 799 | $html .= '</form>'; |
@@ -834,7 +834,7 @@ discard block |
||
| 834 | 834 | |
| 835 | 835 | // Buttons for actions |
| 836 | 836 | if ($action != 'presend' && $action != 'editline') { |
| 837 | - $html .= '<div>' . "\n"; |
|
| 837 | + $html .= '<div>'."\n"; |
|
| 838 | 838 | $parameters = array(); |
| 839 | 839 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 840 | 840 | if ($reshook < 0) { |
@@ -844,10 +844,10 @@ discard block |
||
| 844 | 844 | if (empty($reshook)) { |
| 845 | 845 | if ($permissiontoadd) { |
| 846 | 846 | $url_file = $context->getControllerUrl($context->controller, '', false); |
| 847 | - $html .= '<a href="' . $url_file . '&id=' . $object->id . '&action=edit" role="button">' . $langs->trans('Modify') . '</a>'; |
|
| 847 | + $html .= '<a href="'.$url_file.'&id='.$object->id.'&action=edit" role="button">'.$langs->trans('Modify').'</a>'; |
|
| 848 | 848 | } |
| 849 | 849 | } |
| 850 | - $html .= '</div>' . "\n"; |
|
| 850 | + $html .= '</div>'."\n"; |
|
| 851 | 851 | } |
| 852 | 852 | } |
| 853 | 853 | |
@@ -162,12 +162,12 @@ discard block |
||
| 162 | 162 | $out .= $this->htmlBeforeOutputForm; |
| 163 | 163 | |
| 164 | 164 | if ($editMode) { |
| 165 | - $out .= '<form ' . self::generateAttributesStringFromArray($this->formAttributes) . ' >'; |
|
| 165 | + $out .= '<form '.self::generateAttributesStringFromArray($this->formAttributes).' >'; |
|
| 166 | 166 | |
| 167 | 167 | // generate hidden values from $this->formHiddenInputs |
| 168 | 168 | if (!empty($this->formHiddenInputs) && is_array($this->formHiddenInputs)) { |
| 169 | 169 | foreach ($this->formHiddenInputs as $hiddenKey => $hiddenValue) { |
| 170 | - $out .= '<input type="hidden" name="'.dol_escape_htmltag($hiddenKey).'" value="' . dol_escape_htmltag($hiddenValue) . '">'; |
|
| 170 | + $out .= '<input type="hidden" name="'.dol_escape_htmltag($hiddenKey).'" value="'.dol_escape_htmltag($hiddenValue).'">'; |
|
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | } elseif ($editMode) { |
| 187 | 187 | $out .= '<div class="form-setup-button-container center">'; // Todo : remove .center by adding style to form-setup-button-container css class in all themes |
| 188 | 188 | $out .= $this->htmlOutputMoreButton; |
| 189 | - $out .= '<input class="button button-save" type="submit" value="' . $this->langs->trans("Save") . '">'; // Todo fix dolibarr style for <button and use <button instead of input |
|
| 189 | + $out .= '<input class="button button-save" type="submit" value="'.$this->langs->trans("Save").'">'; // Todo fix dolibarr style for <button and use <button instead of input |
|
| 190 | 190 | /*$out .= ' '; |
| 191 | 191 | $out .= '<a class="button button-cancel" type="submit" href="' . $this->formAttributes['action'] . '">'.$this->langs->trans('Cancel').'</a>'; |
| 192 | 192 | */ |
@@ -230,8 +230,8 @@ discard block |
||
| 230 | 230 | if (empty($hideTitle)) { |
| 231 | 231 | $out .= '<thead>'; |
| 232 | 232 | $out .= '<tr class="liste_titre">'; |
| 233 | - $out .= ' <td>' . $this->langs->trans("Parameter") . '</td>'; |
|
| 234 | - $out .= ' <td>' . $this->langs->trans("Value") . '</td>'; |
|
| 233 | + $out .= ' <td>'.$this->langs->trans("Parameter").'</td>'; |
|
| 234 | + $out .= ' <td>'.$this->langs->trans("Value").'</td>'; |
|
| 235 | 235 | $out .= '</tr>'; |
| 236 | 236 | $out .= '</thead>'; |
| 237 | 237 | } |
@@ -836,7 +836,7 @@ discard block |
||
| 836 | 836 | if (!empty($this->helpText)) { |
| 837 | 837 | return $this->helpText; |
| 838 | 838 | } |
| 839 | - return (($this->langs->trans($this->confKey . 'Tooltip') != $this->confKey . 'Tooltip') ? $this->langs->trans($this->confKey . 'Tooltip') : ''); |
|
| 839 | + return (($this->langs->trans($this->confKey.'Tooltip') != $this->confKey.'Tooltip') ? $this->langs->trans($this->confKey.'Tooltip') : ''); |
|
| 840 | 840 | } |
| 841 | 841 | |
| 842 | 842 | /** |
@@ -853,7 +853,7 @@ discard block |
||
| 853 | 853 | |
| 854 | 854 | // if conf defined on entity 0, prepend a picto to indicate it will apply across all entities |
| 855 | 855 | if (isModEnabled('multicompany') && $this->entity == 0) { |
| 856 | - $out = img_picto($this->langs->trans('AllEntities'), 'fa-globe-americas em088 opacityhigh') . ' ' . $out; |
|
| 856 | + $out = img_picto($this->langs->trans('AllEntities'), 'fa-globe-americas em088 opacityhigh').' '.$out; |
|
| 857 | 857 | } |
| 858 | 858 | |
| 859 | 859 | return $out; |
@@ -901,7 +901,7 @@ discard block |
||
| 901 | 901 | } elseif ($this->type == 'html') { |
| 902 | 902 | $out .= $this->generateInputFieldHtml(); |
| 903 | 903 | } elseif ($this->type == 'color') { |
| 904 | - $out .= $this->generateInputFieldColor(); |
|
| 904 | + $out .= $this->generateInputFieldColor(); |
|
| 905 | 905 | } elseif ($this->type == 'yesno') { |
| 906 | 906 | if (!empty($conf->use_javascript_ajax)) { |
| 907 | 907 | $input = $this->fieldParams['input'] ?? array(); |
@@ -963,7 +963,7 @@ discard block |
||
| 963 | 963 | */ |
| 964 | 964 | public function generateInputFieldTextarea() |
| 965 | 965 | { |
| 966 | - $out = '<textarea class="flat" name="'.$this->confKey.'" id="'.$this->confKey.'" cols="50" rows="5" wrap="soft">' . "\n"; |
|
| 966 | + $out = '<textarea class="flat" name="'.$this->confKey.'" id="'.$this->confKey.'" cols="50" rows="5" wrap="soft">'."\n"; |
|
| 967 | 967 | $out .= dol_htmlentities($this->fieldValue); |
| 968 | 968 | $out .= "</textarea>\n"; |
| 969 | 969 | return $out; |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | */ |
| 977 | 977 | public function generateInputFieldHtml() |
| 978 | 978 | { |
| 979 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
| 979 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
| 980 | 980 | $doleditor = new DolEditor($this->confKey, $this->fieldValue, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); |
| 981 | 981 | return $doleditor->Create(1); |
| 982 | 982 | } |
@@ -1014,7 +1014,7 @@ discard block |
||
| 1014 | 1014 | |
| 1015 | 1015 | $out = ''; |
| 1016 | 1016 | if (preg_match('/emailtemplate:/', $this->type)) { |
| 1017 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
| 1017 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
| 1018 | 1018 | $formmail = new FormMail($this->db); |
| 1019 | 1019 | |
| 1020 | 1020 | $tmp = explode(':', $this->type); |
@@ -1024,10 +1024,10 @@ discard block |
||
| 1024 | 1024 | foreach ($formmail->lines_model as $modelMail) { |
| 1025 | 1025 | $moreonlabel = ''; |
| 1026 | 1026 | if (!empty($arrayOfMessageName[$modelMail->label])) { |
| 1027 | - $moreonlabel = ' <span class="opacitymedium">(' . $this->langs->trans("SeveralLangugeVariatFound") . ')</span>'; |
|
| 1027 | + $moreonlabel = ' <span class="opacitymedium">('.$this->langs->trans("SeveralLangugeVariatFound").')</span>'; |
|
| 1028 | 1028 | } |
| 1029 | 1029 | // The 'label' is the key that is unique if we exclude the language |
| 1030 | - $arrayOfMessageName[$modelMail->id] = $this->langs->trans(preg_replace('/\(|\)/', '', $modelMail->label)) . $moreonlabel; |
|
| 1030 | + $arrayOfMessageName[$modelMail->id] = $this->langs->trans(preg_replace('/\(|\)/', '', $modelMail->label)).$moreonlabel; |
|
| 1031 | 1031 | } |
| 1032 | 1032 | } |
| 1033 | 1033 | $out .= $this->form->selectarray($this->confKey, $arrayOfMessageName, $this->fieldValue, 'None', 0, 0, '', 0, 0, 0, '', '', 1); |
@@ -1086,10 +1086,10 @@ discard block |
||
| 1086 | 1086 | } |
| 1087 | 1087 | $out = '<input required="required" type="password" class="flat" id="'.$this->confKey.'" name="'.$this->confKey.'" value="'.(GETPOST($this->confKey, 'alpha') ? GETPOST($this->confKey, 'alpha') : $this->fieldValue).'"'; |
| 1088 | 1088 | if ($min) { |
| 1089 | - $out .= ' minlength="' . $min . '"'; |
|
| 1089 | + $out .= ' minlength="'.$min.'"'; |
|
| 1090 | 1090 | } |
| 1091 | 1091 | if ($max) { |
| 1092 | - $out .= ' maxlength="' . $max . '"'; |
|
| 1092 | + $out .= ' maxlength="'.$max.'"'; |
|
| 1093 | 1093 | } |
| 1094 | 1094 | $out .= '>'; |
| 1095 | 1095 | return $out; |
@@ -1216,9 +1216,9 @@ discard block |
||
| 1216 | 1216 | } elseif ($this->type == 'selectUser') { |
| 1217 | 1217 | $out .= $this->generateOutputFieldSelectUser(); |
| 1218 | 1218 | } elseif ($this->type == 'html') { |
| 1219 | - $out .= $this->fieldValue; |
|
| 1219 | + $out .= $this->fieldValue; |
|
| 1220 | 1220 | } elseif ($this->type == 'color') { |
| 1221 | - $out .= $this->generateOutputFieldColor(); |
|
| 1221 | + $out .= $this->generateOutputFieldColor(); |
|
| 1222 | 1222 | } elseif ($this->type == 'yesno') { |
| 1223 | 1223 | if (!empty($conf->use_javascript_ajax)) { |
| 1224 | 1224 | $revertonoff = $this->fieldParams['revertonoff'] ? 1 : 0; |
@@ -1234,7 +1234,7 @@ discard block |
||
| 1234 | 1234 | } |
| 1235 | 1235 | } elseif (preg_match('/emailtemplate:/', $this->type)) { |
| 1236 | 1236 | if ($this->fieldValue > 0) { |
| 1237 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
| 1237 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
| 1238 | 1238 | $formmail = new FormMail($this->db); |
| 1239 | 1239 | |
| 1240 | 1240 | $tmp = explode(':', $this->type); |
@@ -1255,9 +1255,9 @@ discard block |
||
| 1255 | 1255 | $ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 1256 | 1256 | $toprint = array(); |
| 1257 | 1257 | foreach ($ways as $way) { |
| 1258 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
| 1258 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
| 1259 | 1259 | } |
| 1260 | - $out .= '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
| 1260 | + $out .= '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
| 1261 | 1261 | } elseif (preg_match('/thirdparty_type/', $this->type)) { |
| 1262 | 1262 | if ($this->fieldValue == 2) { |
| 1263 | 1263 | $out .= $this->langs->trans("Prospect"); |
@@ -1388,7 +1388,7 @@ discard block |
||
| 1388 | 1388 | $outPut = ''; |
| 1389 | 1389 | $user = new User($this->db); |
| 1390 | 1390 | $user->fetch((int) $this->fieldValue); |
| 1391 | - $outPut = $user->firstname . " " . $user->lastname; |
|
| 1391 | + $outPut = $user->firstname." ".$user->lastname; |
|
| 1392 | 1392 | return $outPut; |
| 1393 | 1393 | } |
| 1394 | 1394 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | // Get parameters |
| 62 | 62 | $action = GETPOST('action', 'aZ09'); |
| 63 | -$search_prod = GETPOST('search_prod', 'alpha'); |
|
| 63 | +$search_prod = GETPOST('search_prod', 'alpha'); |
|
| 64 | 64 | $cancel = GETPOST('cancel', 'alpha'); |
| 65 | 65 | $search_label = GETPOST('search_label', 'alpha'); |
| 66 | 66 | $search_price = GETPOST('search_price'); |
@@ -116,8 +116,8 @@ discard block |
||
| 116 | 116 | $prodcustprice->price_min = price2num(GETPOST("price_min"), 'MU'); |
| 117 | 117 | $prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha'); |
| 118 | 118 | $prodcustprice->discount_percent = price2num(GETPOST("discount_percent")); |
| 119 | - $prodcustprice->date_begin = dol_mktime(0, 0, 0, GETPOSTINT('date_beginmonth'), GETPOSTINT('date_beginday'), GETPOSTINT('date_beginyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server; |
|
| 120 | - $prodcustprice->date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 119 | + $prodcustprice->date_begin = dol_mktime(0, 0, 0, GETPOSTINT('date_beginmonth'), GETPOSTINT('date_beginday'), GETPOSTINT('date_beginyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server; |
|
| 120 | + $prodcustprice->date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 121 | 121 | |
| 122 | 122 | $tva_tx_txt = GETPOST('tva_tx', 'alpha'); // tva_tx can be '8.5' or '8.5*' or '8.5 (XXX)' or '8.5* (XXX)' |
| 123 | 123 | |
@@ -217,8 +217,8 @@ discard block |
||
| 217 | 217 | $prodcustprice->tva_tx = str_replace('*', '', GETPOST("tva_tx")); |
| 218 | 218 | $prodcustprice->recuperableonly = (preg_match('/\*/', GETPOST("tva_tx")) ? 1 : 0); |
| 219 | 219 | $prodcustprice->discount_percent = price2num(GETPOST("discount_percent")); |
| 220 | - $prodcustprice->date_begin = dol_mktime(0, 0, 0, GETPOSTINT('date_beginmonth'), GETPOSTINT('date_beginday'), GETPOSTINT('date_beginyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server; |
|
| 221 | - $prodcustprice->date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 220 | + $prodcustprice->date_begin = dol_mktime(0, 0, 0, GETPOSTINT('date_beginmonth'), GETPOSTINT('date_beginday'), GETPOSTINT('date_beginyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server; |
|
| 221 | + $prodcustprice->date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 222 | 222 | |
| 223 | 223 | $result = $prodcustprice->update($user, 0, $update_child_soc); |
| 224 | 224 | if ($result > 0) { |
@@ -383,13 +383,13 @@ discard block |
||
| 383 | 383 | print '<td><input name="ref_customer" size="12"></td></tr>'; |
| 384 | 384 | |
| 385 | 385 | // Applied Prices From |
| 386 | - $date_begin = dol_mktime(0, 0, 0, GETPOSTINT('date_beginmonth'), GETPOSTINT('date_beginday'), GETPOSTINT('date_beginyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server; |
|
| 386 | + $date_begin = dol_mktime(0, 0, 0, GETPOSTINT('date_beginmonth'), GETPOSTINT('date_beginday'), GETPOSTINT('date_beginyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server; |
|
| 387 | 387 | print '<tr><td>'.$langs->trans("AppliedPricesFrom").'</td><td>'; |
| 388 | 388 | print $form->selectDate(!empty($date_begin) ? $date_begin : dol_now(), "date_begin", 0, 0, 1, "date_begin"); |
| 389 | 389 | print '</td></tr>'; |
| 390 | 390 | |
| 391 | 391 | // Applied Prices To |
| 392 | - $date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 392 | + $date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 393 | 393 | print '<tr><td>'.$langs->trans("AppliedPricesTo").'</td><td>'; |
| 394 | 394 | print $form->selectDate($date_end, "date_end", 0, 0, 1, "date_end"); |
| 395 | 395 | print '</td></tr>'; |
@@ -737,7 +737,7 @@ discard block |
||
| 737 | 737 | $extratitle = $langs->trans($value); |
| 738 | 738 | if (!empty($val['visible'])) { |
| 739 | 739 | $visible = (int) dol_eval((string) $val['visible'], 1, 1, '1'); |
| 740 | - $arrayfields['ef.' . $key] = array( |
|
| 740 | + $arrayfields['ef.'.$key] = array( |
|
| 741 | 741 | 'label' => $extratitle, |
| 742 | 742 | 'checked' => (($visible < 0) ? 0 : 1), |
| 743 | 743 | 'position' => (int) $extrafields->attributes['product_customer_price']['pos'][$key], |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); |
| 110 | 110 | } |
| 111 | 111 | if (!$error) { |
| 112 | - $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 112 | + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 113 | 113 | |
| 114 | 114 | $tmparray = explode('_', GETPOST('task_parent')); |
| 115 | 115 | $task_parent = $tmparray[1]; |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | if ($action == 'confirm_merge' && $confirm == 'yes' && $user->hasRight('projet', 'creer')) { |
| 161 | 161 | $task_origin_id = GETPOSTINT('task_origin'); |
| 162 | - $task_origin = new Task($db); // The Task that we will delete |
|
| 162 | + $task_origin = new Task($db); // The Task that we will delete |
|
| 163 | 163 | |
| 164 | 164 | if ($task_origin_id <= 0) { |
| 165 | 165 | $langs->load('errors'); |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | |
| 300 | 300 | $title = $object->ref; |
| 301 | 301 | if (!empty($withproject)) { |
| 302 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '') ; |
|
| 302 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
| 303 | 303 | } |
| 304 | 304 | $help_url = ''; |
| 305 | 305 | |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | $cols = 2; |
| 426 | 426 | $savobject = $object; |
| 427 | 427 | $object = $projectstatic; |
| 428 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
| 428 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
| 429 | 429 | $object = $savobject; |
| 430 | 430 | |
| 431 | 431 | print '</table>'; |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$db->escape($mysoc->country_code)."'"; |
| 168 | 168 | $sql .= " AND t.taux = ".((float) $tva_tx)." AND t.active = 1"; |
| 169 | 169 | $sql .= " AND t.code = '".$db->escape($vatratecode)."'"; |
| 170 | - $sql .= " AND t.type_vat IN (0, 1)"; // Use only VAT rates type all or i.e. the sales type VAT rates. |
|
| 170 | + $sql .= " AND t.type_vat IN (0, 1)"; // Use only VAT rates type all or i.e. the sales type VAT rates. |
|
| 171 | 171 | $sql .= " AND t.entity IN (".getEntity('c_tva').")"; |
| 172 | 172 | $resql = $db->query($sql); |
| 173 | 173 | if ($resql) { |
@@ -755,8 +755,8 @@ discard block |
||
| 755 | 755 | $prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha'); |
| 756 | 756 | $prodcustprice->price_label = GETPOST("price_label", 'alpha'); |
| 757 | 757 | $prodcustprice->discount_percent = price2num(GETPOST("discount_percent")); |
| 758 | - $prodcustprice->date_begin = dol_mktime(0, 0, 0, GETPOSTINT('date_beginmonth'), GETPOSTINT('date_beginday'), GETPOSTINT('date_beginyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server; |
|
| 759 | - $prodcustprice->date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 758 | + $prodcustprice->date_begin = dol_mktime(0, 0, 0, GETPOSTINT('date_beginmonth'), GETPOSTINT('date_beginday'), GETPOSTINT('date_beginyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server; |
|
| 759 | + $prodcustprice->date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 760 | 760 | |
| 761 | 761 | $extralabels = $extrafields->fetch_name_optionals_label("product_customer_price"); |
| 762 | 762 | $extrafield_values = $extrafields->getOptionalsFromPost("product_customer_price"); |
@@ -910,8 +910,8 @@ discard block |
||
| 910 | 910 | $prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha'); |
| 911 | 911 | $prodcustprice->price_label = GETPOST("price_label", 'alpha'); |
| 912 | 912 | $prodcustprice->discount_percent = price2num(GETPOST("discount_percent")); |
| 913 | - $prodcustprice->date_begin = dol_mktime(0, 0, 0, GETPOSTINT('date_beginmonth'), GETPOSTINT('date_beginday'), GETPOSTINT('date_beginyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server; |
|
| 914 | - $prodcustprice->date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 913 | + $prodcustprice->date_begin = dol_mktime(0, 0, 0, GETPOSTINT('date_beginmonth'), GETPOSTINT('date_beginday'), GETPOSTINT('date_beginyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server; |
|
| 914 | + $prodcustprice->date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 915 | 915 | |
| 916 | 916 | $extralabels = $extrafields->fetch_name_optionals_label("product_customer_price"); |
| 917 | 917 | $extrafield_values = $extrafields->getOptionalsFromPost("product_customer_price"); |
@@ -1248,7 +1248,7 @@ discard block |
||
| 1248 | 1248 | } else { |
| 1249 | 1249 | $extratitle = $langs->trans($value); |
| 1250 | 1250 | } |
| 1251 | - $field = 'ef.' . $key; |
|
| 1251 | + $field = 'ef.'.$key; |
|
| 1252 | 1252 | print '<td style="text-align: right">'.$extratitle.'</td>'; |
| 1253 | 1253 | } |
| 1254 | 1254 | } |
@@ -1269,7 +1269,7 @@ discard block |
||
| 1269 | 1269 | print '<input type="hidden" name="action" value="setlabelsellingprice">'; |
| 1270 | 1270 | print '<input type="hidden" name="pricelevel" value="'.$i.'">'; |
| 1271 | 1271 | print $langs->trans("SellingPrice").' '.$i.' - '; |
| 1272 | - print '<input class="maxwidthonsmartphone" type="text" name="labelsellingprice" value="' . getDolGlobalString($keyforlabel).'">'; |
|
| 1272 | + print '<input class="maxwidthonsmartphone" type="text" name="labelsellingprice" value="'.getDolGlobalString($keyforlabel).'">'; |
|
| 1273 | 1273 | print ' <input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
| 1274 | 1274 | print '</form>'; |
| 1275 | 1275 | } else { |
@@ -1455,7 +1455,7 @@ discard block |
||
| 1455 | 1455 | } else { |
| 1456 | 1456 | print price($object->price).' '.$langs->trans($object->price_base_type); |
| 1457 | 1457 | if (getDolGlobalString('PRODUCT_DISPLAY_VAT_INCL_PRICES') && !empty($object->price_ttc)) { |
| 1458 | - print '<i class="opacitymedium"> - ' . price($object->price_ttc).' '.$langs->trans('TTC') . '</i>'; |
|
| 1458 | + print '<i class="opacitymedium"> - '.price($object->price_ttc).' '.$langs->trans('TTC').'</i>'; |
|
| 1459 | 1459 | } |
| 1460 | 1460 | } |
| 1461 | 1461 | |
@@ -1468,7 +1468,7 @@ discard block |
||
| 1468 | 1468 | } else { |
| 1469 | 1469 | print price($object->price_min).' '.$langs->trans($object->price_base_type); |
| 1470 | 1470 | if (getDolGlobalString('PRODUCT_DISPLAY_VAT_INCL_PRICES') && !empty($object->price_min_ttc)) { |
| 1471 | - print '<i class="opacitymedium"> - ' . price($object->price_min_ttc).' '.$langs->trans('TTC') . '</i>'; |
|
| 1471 | + print '<i class="opacitymedium"> - '.price($object->price_min_ttc).' '.$langs->trans('TTC').'</i>'; |
|
| 1472 | 1472 | } |
| 1473 | 1473 | } |
| 1474 | 1474 | print '</td></tr>'; |
@@ -1514,7 +1514,7 @@ discard block |
||
| 1514 | 1514 | print '<input type="hidden" name="priceid" value="'.$object->prices_by_qty_id[0].'">'; // id in product_price |
| 1515 | 1515 | print '<input type="hidden" value="0" name="rowid">'; // id in product_price_by_qty |
| 1516 | 1516 | |
| 1517 | - print '<tr class="'.(($ii % 2) == 0 ? 'pair' : 'impair').'">'; // @phpstan-ignore-line |
|
| 1517 | + print '<tr class="'.(($ii % 2) == 0 ? 'pair' : 'impair').'">'; // @phpstan-ignore-line |
|
| 1518 | 1518 | print '<td><input size="5" type="text" value="1" name="quantity"></td>'; |
| 1519 | 1519 | print '<td class="right"><input class="width50 right" type="text" value="0" name="price"></td>'; |
| 1520 | 1520 | print '<td>'; |
@@ -1602,36 +1602,36 @@ discard block |
||
| 1602 | 1602 | if (empty($reshook)) { |
| 1603 | 1603 | if ($object->isVariant()) { |
| 1604 | 1604 | if ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer')) { |
| 1605 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("NoEditVariants")) . '">' . $langs->trans("UpdateDefaultPrice") . '</a></div>'; |
|
| 1605 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEditVariants")).'">'.$langs->trans("UpdateDefaultPrice").'</a></div>'; |
|
| 1606 | 1606 | } |
| 1607 | 1607 | } else { |
| 1608 | 1608 | if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { |
| 1609 | 1609 | if ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer')) { |
| 1610 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=edit_price&token='.newToken().'&id=' . $object->id . '">' . $langs->trans("UpdateDefaultPrice") . '</a></div>'; |
|
| 1610 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit_price&token='.newToken().'&id='.$object->id.'">'.$langs->trans("UpdateDefaultPrice").'</a></div>'; |
|
| 1611 | 1611 | } else { |
| 1612 | - print '<div class="inline-block divButAction"><span class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">' . $langs->trans("UpdateDefaultPrice") . '</span></div>'; |
|
| 1612 | + print '<div class="inline-block divButAction"><span class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("UpdateDefaultPrice").'</span></div>'; |
|
| 1613 | 1613 | } |
| 1614 | 1614 | } |
| 1615 | 1615 | |
| 1616 | 1616 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { |
| 1617 | 1617 | if ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer')) { |
| 1618 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=add_customer_price&token='.newToken().'&id=' . $object->id . '">' . $langs->trans("AddCustomerPrice") . '</a></div>'; |
|
| 1618 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=add_customer_price&token='.newToken().'&id='.$object->id.'">'.$langs->trans("AddCustomerPrice").'</a></div>'; |
|
| 1619 | 1619 | } else { |
| 1620 | - print '<div class="inline-block divButAction"><span class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">' . $langs->trans("AddCustomerPrice") . '</span></div>'; |
|
| 1620 | + print '<div class="inline-block divButAction"><span class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("AddCustomerPrice").'</span></div>'; |
|
| 1621 | 1621 | } |
| 1622 | 1622 | } |
| 1623 | 1623 | |
| 1624 | 1624 | if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { |
| 1625 | 1625 | if ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer')) { |
| 1626 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=edit_vat&token='.newToken().'&id=' . $object->id . '">' . $langs->trans("UpdateVAT") . '</a></div>'; |
|
| 1626 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit_vat&token='.newToken().'&id='.$object->id.'">'.$langs->trans("UpdateVAT").'</a></div>'; |
|
| 1627 | 1627 | } else { |
| 1628 | - print '<div class="inline-block divButAction"><span class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">' . $langs->trans("UpdateVAT") . '</span></div>'; |
|
| 1628 | + print '<div class="inline-block divButAction"><span class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("UpdateVAT").'</span></div>'; |
|
| 1629 | 1629 | } |
| 1630 | 1630 | |
| 1631 | 1631 | if ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer')) { |
| 1632 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=edit_level_price&token='.newToken().'&id=' . $object->id . '">' . $langs->trans("UpdateLevelPrices") . '</a></div>'; |
|
| 1632 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit_level_price&token='.newToken().'&id='.$object->id.'">'.$langs->trans("UpdateLevelPrices").'</a></div>'; |
|
| 1633 | 1633 | } else { |
| 1634 | - print '<div class="inline-block divButAction"><span class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">' . $langs->trans("UpdateLevelPrices") . '</span></div>'; |
|
| 1634 | + print '<div class="inline-block divButAction"><span class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("UpdateLevelPrices").'</span></div>'; |
|
| 1635 | 1635 | } |
| 1636 | 1636 | } |
| 1637 | 1637 | } |
@@ -1776,7 +1776,7 @@ discard block |
||
| 1776 | 1776 | print $form->textwithpicto($langs->trans("PackagingForThisProduct"), $langs->trans("PackagingForThisProductSellDesc")); |
| 1777 | 1777 | print '</td><td>'; |
| 1778 | 1778 | $packaging = $object->packaging; |
| 1779 | - print '<input class="flat" name="packaging" size="5" value="' . price($packaging, 0, '', 1, -1, 2).'">'; |
|
| 1779 | + print '<input class="flat" name="packaging" size="5" value="'.price($packaging, 0, '', 1, -1, 2).'">'; |
|
| 1780 | 1780 | print '</td>'; |
| 1781 | 1781 | print '</tr>'; |
| 1782 | 1782 | } |
@@ -2045,17 +2045,17 @@ discard block |
||
| 2045 | 2045 | print '</tr>'; |
| 2046 | 2046 | |
| 2047 | 2047 | // Ref. Customer |
| 2048 | - print '<tr><td>' . $langs->trans('RefCustomer') . '</td>'; |
|
| 2048 | + print '<tr><td>'.$langs->trans('RefCustomer').'</td>'; |
|
| 2049 | 2049 | print '<td><input name="ref_customer" size="12"></td></tr>'; |
| 2050 | 2050 | |
| 2051 | 2051 | // Applied Prices From |
| 2052 | - $date_begin = dol_mktime(0, 0, 0, GETPOSTINT('date_beginmonth'), GETPOSTINT('date_beginday'), GETPOSTINT('date_beginyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server; |
|
| 2052 | + $date_begin = dol_mktime(0, 0, 0, GETPOSTINT('date_beginmonth'), GETPOSTINT('date_beginday'), GETPOSTINT('date_beginyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server; |
|
| 2053 | 2053 | print '<tr><td>'.$langs->trans("AppliedPricesFrom").'</td><td>'; |
| 2054 | 2054 | print $form->selectDate(!empty($date_begin) ? $date_begin : dol_now(), "date_begin", 0, 0, 1, "date_begin"); |
| 2055 | 2055 | print '</td></tr>'; |
| 2056 | 2056 | |
| 2057 | 2057 | // Applied Prices To |
| 2058 | - $date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 2058 | + $date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 2059 | 2059 | print '<tr><td>'.$langs->trans("AppliedPricesTo").'</td><td>'; |
| 2060 | 2060 | print $form->selectDate($date_end, "date_end", 0, 0, 1, "date_end"); |
| 2061 | 2061 | print '</td></tr>'; |
@@ -2180,8 +2180,8 @@ discard block |
||
| 2180 | 2180 | print '</tr>'; |
| 2181 | 2181 | |
| 2182 | 2182 | // Ref. Customer |
| 2183 | - print '<tr><td>' . $langs->trans('RefCustomer') . '</td>'; |
|
| 2184 | - print '<td><input name="ref_customer" size="12" value="' . dol_escape_htmltag($prodcustprice->ref_customer) . '"></td></tr>'; |
|
| 2183 | + print '<tr><td>'.$langs->trans('RefCustomer').'</td>'; |
|
| 2184 | + print '<td><input name="ref_customer" size="12" value="'.dol_escape_htmltag($prodcustprice->ref_customer).'"></td></tr>'; |
|
| 2185 | 2185 | |
| 2186 | 2186 | // Applied Prices From |
| 2187 | 2187 | print '<tr><td>'.$langs->trans("AppliedPricesFrom").'</td><td>'; |
@@ -2567,7 +2567,7 @@ discard block |
||
| 2567 | 2567 | if (!getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { |
| 2568 | 2568 | print '<!-- PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES -->'."\n"; |
| 2569 | 2569 | print '<tr class="oddeven">'; |
| 2570 | - print '<td colspan="4">' . $langs->trans('Default') . '</td>'; |
|
| 2570 | + print '<td colspan="4">'.$langs->trans('Default').'</td>'; |
|
| 2571 | 2571 | |
| 2572 | 2572 | print '<td class="center">'.$langs->trans($object->price_base_type)."</td>"; |
| 2573 | 2573 | |
@@ -182,19 +182,19 @@ discard block |
||
| 182 | 182 | global $langs; |
| 183 | 183 | |
| 184 | 184 | $sql = "SELECT COUNT(*) AS nb"; |
| 185 | - $sql .= " FROM " . $this->db->prefix() . "product_customer_price as t"; |
|
| 186 | - $sql .= " WHERE (t.date_begin = '" . $this->db->idate($this->date_begin) . "' OR t.date_end = '" . $this->db->idate($this->date_begin) . "'"; |
|
| 187 | - $sql .= " OR t.date_begin = '" . $this->db->idate($this->date_end) . "' OR t.date_end = '" . $this->db->idate($this->date_end) . "'"; |
|
| 188 | - $sql .= " OR (t.date_begin <= '" . $this->db->idate($this->date_begin) . "' AND '" . $this->db->idate($this->date_begin) . "' <= t.date_end)"; |
|
| 189 | - $sql .= " OR (t.date_begin <= '" . $this->db->idate($this->date_end) . "' AND '" . $this->db->idate($this->date_end) . "' <= t.date_end))"; |
|
| 190 | - if ($this->fk_product > 0) $sql .= " AND t.fk_product = " . ((int) $this->fk_product); |
|
| 191 | - if ($this->fk_soc > 0) $sql .= " AND t.fk_soc = " . ((int) $this->fk_soc); |
|
| 192 | - if ($this->id > 0) $sql .= " AND t.rowid != " . ((int) $this->id); |
|
| 193 | - |
|
| 194 | - dol_syslog(get_class($this) . "::fetch", LOG_DEBUG); |
|
| 185 | + $sql .= " FROM ".$this->db->prefix()."product_customer_price as t"; |
|
| 186 | + $sql .= " WHERE (t.date_begin = '".$this->db->idate($this->date_begin)."' OR t.date_end = '".$this->db->idate($this->date_begin)."'"; |
|
| 187 | + $sql .= " OR t.date_begin = '".$this->db->idate($this->date_end)."' OR t.date_end = '".$this->db->idate($this->date_end)."'"; |
|
| 188 | + $sql .= " OR (t.date_begin <= '".$this->db->idate($this->date_begin)."' AND '".$this->db->idate($this->date_begin)."' <= t.date_end)"; |
|
| 189 | + $sql .= " OR (t.date_begin <= '".$this->db->idate($this->date_end)."' AND '".$this->db->idate($this->date_end)."' <= t.date_end))"; |
|
| 190 | + if ($this->fk_product > 0) $sql .= " AND t.fk_product = ".((int) $this->fk_product); |
|
| 191 | + if ($this->fk_soc > 0) $sql .= " AND t.fk_soc = ".((int) $this->fk_soc); |
|
| 192 | + if ($this->id > 0) $sql .= " AND t.rowid != ".((int) $this->id); |
|
| 193 | + |
|
| 194 | + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); |
|
| 195 | 195 | $resql = $this->db->query($sql); |
| 196 | 196 | if (!$resql) { |
| 197 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
| 197 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
| 198 | 198 | return -1; |
| 199 | 199 | } |
| 200 | 200 | |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | $sql .= " '".$this->db->idate($this->date_begin)."',"; |
| 370 | 370 | $sql .= " ".(empty($this->date_end) ? 'NULL' : "'".$this->db->idate($this->date_end)."'").","; |
| 371 | 371 | $sql .= " ".((int) $user->id).","; |
| 372 | - $sql .= " ".(!isset($this->price_label) ? 'NULL' : "'".$this->db->escape($this->price_label)."'").","; |
|
| 372 | + $sql .= " ".(!isset($this->price_label) ? 'NULL' : "'".$this->db->escape($this->price_label)."'").","; |
|
| 373 | 373 | $sql .= " ".(!isset($this->import_key) ? 'NULL' : "'".$this->db->escape($this->import_key)."'"); |
| 374 | 374 | $sql .= ")"; |
| 375 | 375 | |
@@ -187,9 +187,15 @@ |
||
| 187 | 187 | $sql .= " OR t.date_begin = '" . $this->db->idate($this->date_end) . "' OR t.date_end = '" . $this->db->idate($this->date_end) . "'"; |
| 188 | 188 | $sql .= " OR (t.date_begin <= '" . $this->db->idate($this->date_begin) . "' AND '" . $this->db->idate($this->date_begin) . "' <= t.date_end)"; |
| 189 | 189 | $sql .= " OR (t.date_begin <= '" . $this->db->idate($this->date_end) . "' AND '" . $this->db->idate($this->date_end) . "' <= t.date_end))"; |
| 190 | - if ($this->fk_product > 0) $sql .= " AND t.fk_product = " . ((int) $this->fk_product); |
|
| 191 | - if ($this->fk_soc > 0) $sql .= " AND t.fk_soc = " . ((int) $this->fk_soc); |
|
| 192 | - if ($this->id > 0) $sql .= " AND t.rowid != " . ((int) $this->id); |
|
| 190 | + if ($this->fk_product > 0) { |
|
| 191 | + $sql .= " AND t.fk_product = " . ((int) $this->fk_product); |
|
| 192 | + } |
|
| 193 | + if ($this->fk_soc > 0) { |
|
| 194 | + $sql .= " AND t.fk_soc = " . ((int) $this->fk_soc); |
|
| 195 | + } |
|
| 196 | + if ($this->id > 0) { |
|
| 197 | + $sql .= " AND t.rowid != " . ((int) $this->id); |
|
| 198 | + } |
|
| 193 | 199 | |
| 194 | 200 | dol_syslog(get_class($this) . "::fetch", LOG_DEBUG); |
| 195 | 201 | $resql = $this->db->query($sql); |