diff --git a/htdocs/accountancy/journal/variousjournal.php b/htdocs/accountancy/journal/variousjournal.php index 0d95ff61763..49b4fc2c98c 100644 --- a/htdocs/accountancy/journal/variousjournal.php +++ b/htdocs/accountancy/journal/variousjournal.php @@ -43,17 +43,6 @@ if ($in_bookkeeping == '') { $in_bookkeeping = 'notyet'; } -// Security check -if (empty($conf->accounting->enabled)) { - accessforbidden(); -} -if ($user->socid > 0) { - accessforbidden(); -} -if (empty($user->rights->accounting->mouvements->lire)) { - accessforbidden(); -} - // Get information of journal $object = new AccountingJournal($db); $result = $object->fetch($id_journal); @@ -65,7 +54,7 @@ if ($result > 0) { accessforbidden($langs->trans('ErrorRecordNotFound')); } -$hookmanager->initHooks(array('globaljournal', $object->nature_text . 'journal')); +$hookmanager->initHooks(array('globaljournal', $object->nature.'journal')); $parameters = array(); $date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); @@ -93,6 +82,18 @@ if (!is_array($journal_data)) { setEventMessages($object->error, $object->errors, 'errors'); } +// Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} + + /* * Actions */ diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index f82df06313b..b3d3dd25e90 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -961,7 +961,7 @@ if ($action == 'create') { if (GETPOST('cancel', 'alpha') || $confirm == 'no' || $action == '' || in_array($action, array('settodraft', 'valid', 'delete', 'sendall', 'clone', 'test'))) { print "\n\n
\n"; - if (($object->statut == 1) && ($user->rights->mailing->valider || $object->fk_user_valid == $user->id)) { + if (($object->statut == 1) && ($user->rights->mailing->valider || $object->user_validation == $user->id)) { print ''.$langs->trans("SetToDraft").''; } @@ -1066,7 +1066,7 @@ if ($action == 'create') { print dol_get_fiche_end(); - print dol_set_focus('#sendto'); + dol_set_focus('#sendto'); } diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 588faa392e3..0c2bf539384 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -86,6 +86,11 @@ class Mailing extends CommonObject */ public $email_from; + /** + * @var string email to + */ + public $sendto; + /** * @var string email reply to */ @@ -175,6 +180,11 @@ class Mailing extends CommonObject */ public $statuts = array(); + /** + * @var array substitutionarray + */ + public $substitutionarray; + /** * Constructor diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 487c075b3a1..587972fa83b 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -181,6 +181,12 @@ class Contact extends CommonObject */ public $email; + /** + * URL + * @var string + */ + public $url; + /** * Unsuscribe all : 1 = contact has globaly unsubscribe of all mass emailings * @var int @@ -315,6 +321,7 @@ class Contact extends CommonObject */ public $stcomm_picto; + /** * Constructor * diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index dc35cfbc7aa..e88b42950f3 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -93,12 +93,17 @@ abstract class CommonInvoice extends CommonObject const STATUS_ABANDONED = 3; + public $totalpaid; // duplicate with sumpayed + public $totaldeposits; // duplicate with sumdeposit + public $totalcreditnotes; // duplicate with sumcreditnote + public $sumpayed; public $sumpayed_multicurrency; public $sumdeposit; public $sumdeposit_multicurrency; public $sumcreditnote; public $sumcreditnote_multicurrency; + public $remaintopay; /** diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e1c2bf662df..079401d045a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -115,6 +115,11 @@ abstract class CommonObject */ public $array_languages = null; // Value is array() when load already tried + /** + * @var array To sotre result of ->liste_contact() + */ + public $contacts_ids; + /** * @var mixed Array of linked objects, set and used when calling ->create() to be able to create links during the creation of object */ diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 37b8d580d1c..da3ba49095f 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -917,44 +917,46 @@ class dolReceiptPrinter extends Printer $resql = $this->db->query($sql); if ($resql) { $obj = $this->db->fetch_array($resql); + if (empty($obj)) { + $error++; + $this->errors[] = 'PrinterDontExist'; + } + if (!$error) { + $parameter = (isset($obj['parameter']) ? $obj['parameter'] : ''); + try { + $type = $obj['fk_type']; + switch ($type) { + case 1: + $this->connector = new DummyPrintConnector(); + break; + case 2: + $this->connector = new FilePrintConnector($parameter); + break; + case 3: + $parameters = explode(':', $parameter); + $this->connector = new NetworkPrintConnector($parameters[0], $parameters[1]); + break; + case 4: // LPT1, smb://... + $this->connector = new WindowsPrintConnector(dol_sanitizePathName($parameter)); + break; + case 5: + $this->connector = new CupsPrintConnector($parameter); + break; + default: + $this->connector = 'CONNECTOR_UNKNOWN'; + break; + } + $this->printer = new Printer($this->connector, $this->profile); + } catch (Exception $e) { + $this->errors[] = $e->getMessage(); + $error++; + } + } } else { $error++; $this->errors[] = $this->db->lasterror; } - if (empty($obj)) { - $error++; - $this->errors[] = 'PrinterDontExist'; - } - if (!$error) { - $parameter = $obj['parameter']; - try { - switch ($obj['fk_type']) { - case 1: - $this->connector = new DummyPrintConnector(); - break; - case 2: - $this->connector = new FilePrintConnector($parameter); - break; - case 3: - $parameters = explode(':', $parameter); - $this->connector = new NetworkPrintConnector($parameters[0], $parameters[1]); - break; - case 4: // LPT1, smb://... - $this->connector = new WindowsPrintConnector(dol_sanitizePathName($parameter)); - break; - case 5: - $this->connector = new CupsPrintConnector($parameter); - break; - default: - $this->connector = 'CONNECTOR_UNKNOWN'; - break; - } - $this->printer = new Printer($this->connector, $this->profile); - } catch (Exception $e) { - $this->errors[] = $e->getMessage(); - $error++; - } - } + return $error; } } diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 37223701ff7..a4232095f4b 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -527,102 +527,100 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t if ($mode == 'target' || preg_match('/targetwithdetails/', $mode)) { if ($usecontact) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs, 1)); + if (is_object($targetcontact)) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs, 1)); - if (!empty($targetcontact->address)) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcontact)); - } else { - $companytouseforaddress = $targetcompany; + if (!empty($targetcontact->address)) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcontact)); + } else { + $companytouseforaddress = $targetcompany; - // Contact on a thirdparty that is a different thirdparty than the thirdparty of object - if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) { - $targetcontact->fetch_thirdparty(); - $companytouseforaddress = $targetcontact->thirdparty; + // Contact on a thirdparty that is a different thirdparty than the thirdparty of object + if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) { + $targetcontact->fetch_thirdparty(); + $companytouseforaddress = $targetcontact->thirdparty; + } + + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($companytouseforaddress)); + } + // Country + if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->country_code)); + } elseif (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code)); } - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($companytouseforaddress)); - } - // Country - if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->country_code)); - } elseif (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code)); - } - - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/', $mode)) { - // Phone - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/', $mode)) { - if (!empty($targetcontact->phone_pro) || !empty($targetcontact->phone_mobile)) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Phone").": "; + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/', $mode)) { + // Phone + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/', $mode)) { + if (!empty($targetcontact->phone_pro) || !empty($targetcontact->phone_mobile)) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Phone").": "; + } + if (!empty($targetcontact->phone_pro)) { + $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_pro); + } + if (!empty($targetcontact->phone_pro) && !empty($targetcontact->phone_mobile)) { + $stringaddress .= " / "; + } + if (!empty($targetcontact->phone_mobile)) { + $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_mobile); + } } - if (!empty($targetcontact->phone_pro)) { - $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_pro); + // Fax + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/', $mode)) { + if ($targetcontact->fax) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax); + } } - if (!empty($targetcontact->phone_pro) && !empty($targetcontact->phone_mobile)) { - $stringaddress .= " / "; + // EMail + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/', $mode)) { + if ($targetcontact->email) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcontact->email); + } } - if (!empty($targetcontact->phone_mobile)) { - $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_mobile); - } - } - // Fax - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/', $mode)) { - if ($targetcontact->fax) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax); - } - } - // EMail - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/', $mode)) { - if ($targetcontact->email) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcontact->email); - } - } - // Web - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/', $mode)) { - if ($targetcontact->url) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcontact->url); + // Web + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/', $mode)) { + if ($targetcontact->url) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcontact->url); + } } } } } else { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcompany)); - // Country - if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code)); - } + if (is_object($targetcompany)) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcompany)); + // Country + if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code)); + } - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/', $mode)) { - // Phone - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/', $mode)) { - if (!empty($targetcompany->phone) || !empty($targetcompany->phone_mobile)) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Phone").": "; + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/', $mode)) { + // Phone + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/', $mode)) { + if (!empty($targetcompany->phone)) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Phone").": "; + } + if (!empty($targetcompany->phone)) { + $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone); + } } - if (!empty($targetcompany->phone)) { - $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone); + // Fax + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/', $mode)) { + if ($targetcompany->fax) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax); + } } - if (!empty($targetcompany->phone) && !empty($targetcompany->phone_mobile)) { - $stringaddress .= " / "; + // EMail + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/', $mode)) { + if ($targetcompany->email) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcompany->email); + } } - if (!empty($targetcompany->phone_mobile)) { - $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone_mobile); - } - } - // Fax - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/', $mode)) { - if ($targetcompany->fax) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax); - } - } - // EMail - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/', $mode)) { - if ($targetcompany->email) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcompany->email); - } - } - // Web - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/', $mode)) { - if ($targetcompany->url) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcompany->url); + // Web + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/', $mode)) { + if ($targetcompany->url) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcompany->url); + } } } } diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index d51692812be..abd05f63651 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -138,6 +138,14 @@ class pdf_beluga extends ModelePDFProjects */ public $emetteur; + public $posxref; + public $posxdate; + public $posxsociete; + public $posxamountht; + public $posxamountttc; + public $posstatut; + + /** * Constructor * @@ -479,7 +487,7 @@ class pdf_beluga extends ModelePDFProjects } //var_dump("$key, $tablename, $datefieldname, $dates, $datee"); - $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee, $projectField); + $elementarray = $object->get_element_list($key, $tablename, $datefieldname, '', '', $projectField); $num = count($elementarray); if ($num >= 0) { @@ -492,7 +500,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetXY($this->posxref, $curY); $pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L'); - $selectList = $formproject->select_element($tablename, $project->thirdparty->id, '', -2, $projectField); + $selectList = $formproject->select_element($tablename, $object->thirdparty->id, '', -2, $projectField); $nexY = $pdf->GetY() + 1; $curY = $nexY; $pdf->SetXY($this->posxref, $curY); @@ -790,8 +798,6 @@ class pdf_beluga extends ModelePDFProjects */ protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0) { - global $conf, $mysoc; - $heightoftitleline = 10; $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -806,24 +812,6 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('', '', $default_font_size); - - $pdf->SetXY($this->posxref, $tab_top + 1); - $pdf->MultiCell($this->posxlabel - $this->posxref, 3, $outputlangs->transnoentities("Tasks"), '', 'L'); - - $pdf->SetXY($this->posxlabel, $tab_top + 1); - $pdf->MultiCell($this->posxworkload - $this->posxlabel, 3, $outputlangs->transnoentities("Description"), 0, 'L'); - - $pdf->SetXY($this->posxworkload, $tab_top + 1); - $pdf->MultiCell($this->posxprogress - $this->posxworkload, 3, $outputlangs->transnoentities("PlannedWorkloadShort"), 0, 'R'); - - $pdf->SetXY($this->posxprogress, $tab_top + 1); - $pdf->MultiCell($this->posxdatestart - $this->posxprogress, 3, '%', 0, 'R'); - - $pdf->SetXY($this->posxdatestart, $tab_top + 1); - $pdf->MultiCell($this->posxdateend - $this->posxdatestart, 3, '', 0, 'C'); - - $pdf->SetXY($this->posxdateend, $tab_top + 1); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxdatestart, 3, '', 0, 'C'); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 840d6d9c3ba..298ad489764 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -240,7 +240,7 @@ class InterfaceTicketEmail extends DolibarrTriggers unset($linked_contacts); } if ($sendto) { - $this->composeAndSendCustomerMessage($sendto, $subject_customer, $body_customer, $see_ticket_customer, $object, $langs, $conf); + $this->composeAndSendCustomerMessage($sendto, $subject_customer, $body_customer, $see_ticket_customer, $object, $langs); } } $ok = 1; diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index d38f6deb2bc..0eaf22b5aec 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -1029,10 +1029,8 @@ if ($step == 4 && $datatoimport) { print '
'."\n"; // List of source fields - $var = true; $lefti = 1; foreach ($fieldssource as $key => $val) { - $var = !$var; show_elem($fieldssource, $key, $val, $var); // key is field number in source file $listofkeys[$key] = 1; $fieldsplaced[$key] = 1; @@ -2210,7 +2208,7 @@ $db->close(); * @param array $fieldssource List of source fields * @param int $pos Pos * @param string $key Key - * @param boolean $var Line style (odd or not) + * @param boolean $var Line style (odd or not). No more used. * @param int $nostyle Hide style * @return void */ diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index fa5a9041674..87e34c0c37e 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -1422,11 +1422,9 @@ function migrate_paiementfourn_facturefourn($db, $langs, $conf) if ($select_resql) { $select_num = $db->num_rows($select_resql); $i = 0; - $var = true; // Pour chaque paiement fournisseur, on insere une ligne dans paiementfourn_facturefourn while (($i < $select_num) && (!$error)) { - $var = !$var; $select_obj = $db->fetch_object($select_resql); // Verifier si la ligne est deja dans la nouvelle table. On ne veut pas inserer de doublons. diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index f4137b8b791..e8e32f73d0f 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1367,7 +1367,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { if ($dirins && $action == 'initdic' && $module && $dicname) { if (!$error) { $newdicname = $dicname; - if (!preg_match('/^c_/, $newdicname')) { + if (!preg_match('/^c_/', $newdicname)) { $newdicname = 'c_'.$dicname; } diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 0eb48739f9b..a9488e30672 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1268,6 +1268,7 @@ if ($action == 'create' || $action == 'presend') { $companystatic = new Societe($db); $contactstatic = new Contact($db); $userstatic = new User($db); + $var = false; foreach (array('internal', 'external') as $source) { $tmpobject = $object; $tab = $tmpobject->listeContact(-1, $source); diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index b185ea4ce42..fa9a438e350 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -257,7 +257,7 @@ $formfile = new FormFile($db); if ($action == 'create') { print load_fiche_titre($langs->trans("NewGroup"), '', 'object_group'); - print dol_set_focus('#nom'); + dol_set_focus('#nom'); print '
'; print '';