diff --git a/ChangeLog b/ChangeLog index b3417c85c05..d99ed9a5836 100644 --- a/ChangeLog +++ b/ChangeLog @@ -152,6 +152,7 @@ NEW: #4301 For Developers or integrators: +NEW: Compatible with PHP 7.4 NEW: Code for extrafields uses the new array $extrafields->attributes NEW: Can set a filter on object linked in modulebuilder. NEW: Can defined a position of numbering submodules for thirdparties diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 20854f57279..30ecafcf3e4 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -691,14 +691,14 @@ if ($rowid > 0) print ''; print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'c.rowid', '', $param, '', $sortfield, $sortorder); - print_liste_field_titre('DateCreation', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); - print_liste_field_titre('Type', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); - print_liste_field_titre('DateStart', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); - print_liste_field_titre('DateEnd', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); - print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); + print_liste_field_titre('DateCreation', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre('Type', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre('DateStart', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre('DateEnd', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); if (!empty($conf->banque->enabled)) { - print_liste_field_titre('Account', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); + print_liste_field_titre('Account', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); } print "\n"; diff --git a/htdocs/bom/admin/index.html b/htdocs/bom/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/bom/admin/setup.php b/htdocs/bom/admin/setup.php deleted file mode 100644 index 6abad8e3d58..00000000000 --- a/htdocs/bom/admin/setup.php +++ /dev/null @@ -1,129 +0,0 @@ - - * Copyright (C) 2019 Maxime Kohlhaas - * Copyright (C) 2019 Frédéric France - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file bom/admin/setup.php - * \ingroup bom - * \brief Bom setup page. - */ - -// Load Dolibarr environment -require '../../main.inc.php'; -// Libraries -require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; -require_once '../lib/bom.lib.php'; -//require_once "../class/myclass.class.php"; - -// Translations -$langs->loadLangs(array("admin", "mrp")); - -// Access control -if (!$user->admin) accessforbidden(); - -// Parameters -$action = GETPOST('action', 'alpha'); -$backtopage = GETPOST('backtopage', 'alpha'); - -$arrayofparameters = array( - 'BILLOFMATERIALS_MYPARAM1'=>array('css'=>'minwidth200', 'enabled'=>1), - 'BILLOFMATERIALS_MYPARAM2'=>array('css'=>'minwidth500', 'enabled'=>1) -); - - -/* - * Actions - */ -include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; - -/* - * View - */ - -$page_name = "BomSetup"; -llxHeader('', $langs->trans($page_name)); - -// Subheader -$linkback = ''.$langs->trans("BackToModuleList").''; - -print load_fiche_titre($langs->trans($page_name), $linkback, 'object_bom'); - -// Configuration header -$head = bomAdminPrepareHead(); -dol_fiche_head($head, 'settings', '', -1, "bom"); - -// Setup page goes here -echo $langs->trans("BomSetupPage").'

'; - - -if ($action == 'edit') -{ - print '
'; - print ''; - print ''; - - print ''; - print ''; - - foreach ($arrayofparameters as $key => $val) - { - print ''; - } - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip')); - print '
'; - - print '
'; - print ''; - print '
'; - - print '
'; - print '
'; -} -else -{ - if (!empty($arrayofparameters)) - { - print ''; - print ''; - - foreach ($arrayofparameters as $key => $val) - { - print ''; - } - - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip')); - print ''.$conf->global->$key.'
'; - - print '
'; - print ''.$langs->trans("Modify").''; - print '
'; - } - else - { - print '
'.$langs->trans("NothingToSetup"); - } -} - - -// Page end -dol_fiche_end(); - -llxFooter(); -$db->close(); diff --git a/htdocs/cashdesk/tpl/validation2.tpl.php b/htdocs/cashdesk/tpl/validation2.tpl.php index 624f4ef9701..eab69c6b35d 100644 --- a/htdocs/cashdesk/tpl/validation2.tpl.php +++ b/htdocs/cashdesk/tpl/validation2.tpl.php @@ -48,9 +48,9 @@ $langs->loadLangs(array("main","bills")); -

trans("ShowInvoice"); ?>

+

trans("ShowInvoice"); ?>


-

trans("PrintTicket"); ?>

+

trans("PrintTicket"); ?>

diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index dbceabf642e..2a32e173d3b 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2019 Laurent Destailleur * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry @@ -238,6 +238,7 @@ print ''; print ''; +print '
'; print ''; print ''; print ''; @@ -261,6 +262,7 @@ print ''; print "
'.$langs->trans("TransferFrom").''.$langs->trans("TransferTo").''.$langs->trans("Date").''.$langs->trans("Description").''.$langs->trans("Amount").'
"; +print '
'; print '
'; diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index f4a88f8eba2..2db276ebbbe 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -456,7 +456,7 @@ if ($id) print '
'; print '
'; - print ''; + print '
'; // Label print ''; diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index 2a56122d6f3..37ff26b0b4b 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -134,7 +134,7 @@ if ($object->id) print '
'.$langs->trans("Label").''.$object->label.'
'; - print ''; + print ''; print ''; print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index a9eb9d52433..4050d081fe4 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -49,10 +49,10 @@ class BonPrelevement extends CommonObject */ public $table_element = 'prelevement_bons'; - /** - * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png - */ - public $picto = 'payment'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'payment'; public $date_echeance; public $raison_sociale; @@ -116,7 +116,7 @@ class BonPrelevement extends CommonObject $this->fetched = 0; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Add invoice to withdrawal * @@ -132,7 +132,7 @@ class BonPrelevement extends CommonObject */ public function AddFacture($facture_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key) { - // phpcs:enable + // phpcs:enable $result = 0; $line_id = 0; @@ -196,8 +196,8 @@ class BonPrelevement extends CommonObject if ($concat == 1) { /* - * We aggregate the lines - */ + * We aggregate the lines + */ $sql = "SELECT rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes"; $sql .= " WHERE fk_prelevement_bons = ".$this->id; @@ -219,8 +219,8 @@ class BonPrelevement extends CommonObject else { /* - * No aggregate - */ + * No aggregate + */ $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_lignes ("; $sql .= "fk_prelevement_bons"; $sql .= ", fk_soc"; @@ -335,7 +335,7 @@ class BonPrelevement extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Set credite and set status of linked invoices. Still used ?? * @@ -343,7 +343,7 @@ class BonPrelevement extends CommonObject */ public function set_credite() { - // phpcs:enable + // phpcs:enable global $user, $conf; $error = 0; @@ -351,7 +351,7 @@ class BonPrelevement extends CommonObject if ($this->db->begin()) { $sql = " UPDATE ".MAIN_DB_PREFIX."prelevement_bons"; - $sql .= " SET statut = 1"; + $sql .= " SET statut = ".self::STATUS_TRANSFERED; $sql .= " WHERE rowid = ".$this->id; $sql .= " AND entity = ".$conf->entity; @@ -392,8 +392,8 @@ class BonPrelevement extends CommonObject } /* - * End of procedure - */ + * End of procedure + */ if (!$error) { $this->db->commit(); @@ -414,7 +414,7 @@ class BonPrelevement extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Set direct debit order to "credited" status. * @@ -424,7 +424,7 @@ class BonPrelevement extends CommonObject */ public function set_infocredit($user, $date) { - // phpcs:enable + // phpcs:enable global $conf, $langs; $error = 0; @@ -437,11 +437,11 @@ class BonPrelevement extends CommonObject { $sql = " UPDATE ".MAIN_DB_PREFIX."prelevement_bons "; $sql .= " SET fk_user_credit = ".$user->id; - $sql .= ", statut = 2"; + $sql .= ", statut = ".self::STATUS_CREDITED; $sql .= ", date_credit = '".$this->db->idate($date)."'"; $sql .= " WHERE rowid=".$this->id; $sql .= " AND entity = ".$conf->entity; - $sql .= " AND statut = 1"; + $sql .= " AND statut = ".self::STATUS_TRANSFERED; if ($this->db->query($sql)) { @@ -483,7 +483,8 @@ class BonPrelevement extends CommonObject $paiement->datepaye = $date; $paiement->amounts = $cursoramounts; // Array with detail of dispatching of payments for each invoice $paiement->paiementid = 3; // - $paiement->num_paiement = $this->ref; // Set ref of direct debit note + $paiement->num_payment = $this->ref; // Set ref of direct debit note + $paiement->num_paiement = $this->ref; // For bacward compatibility $paiement->id_prelevement = $this->id; $paiement_id = $paiement->create($user); @@ -525,12 +526,12 @@ class BonPrelevement extends CommonObject } /* - * End of procedure - */ + * End of procedure + */ if ($error == 0) { $this->date_credit = $date; - $this->statut = 1; + $this->statut = self::STATUS_CREDITED; $this->db->commit(); return 0; @@ -560,7 +561,7 @@ class BonPrelevement extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Set withdrawal to transmited status * @@ -571,7 +572,7 @@ class BonPrelevement extends CommonObject */ public function set_infotrans($user, $date, $method) { - // phpcs:enable + // phpcs:enable global $conf, $langs; $error = 0; @@ -639,9 +640,9 @@ class BonPrelevement extends CommonObject $arr = array(); /* - * Returns all invoices presented - * within a withdrawal receipt - */ + * Returns all invoices presented + * within a withdrawal receipt + */ $sql = "SELECT fk_facture"; if ($amounts) $sql .= ", SUM(pl.amount)"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; @@ -685,7 +686,7 @@ class BonPrelevement extends CommonObject return $arr; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Returns amount of withdrawal * @@ -693,7 +694,7 @@ class BonPrelevement extends CommonObject */ public function SommeAPrelever() { - // phpcs:enable + // phpcs:enable global $conf; $sql = "SELECT sum(pfd.amount) as nb"; @@ -724,7 +725,7 @@ class BonPrelevement extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Get number of invoices to withdrawal * TODO delete params banque and agence when not necesary @@ -735,7 +736,7 @@ class BonPrelevement extends CommonObject */ public function NbFactureAPrelever($banque = 0, $agence = 0) { - // phpcs:enable + // phpcs:enable global $conf; $sql = "SELECT count(f.rowid) as nb"; @@ -769,7 +770,7 @@ class BonPrelevement extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Create a withdraw * TODO delete params banque and agence when not necesary @@ -784,7 +785,7 @@ class BonPrelevement extends CommonObject */ public function Create($banque = 0, $agence = 0, $mode = 'real', $format = 'ALL', $executiondate = '', $notrigger = 0) { - // phpcs:enable + // phpcs:enable global $conf, $langs, $user; dol_syslog(__METHOD__."::Bank=".$banque." Office=".$agence." mode=".$mode." format=".$format, LOG_DEBUG); @@ -797,8 +798,8 @@ class BonPrelevement extends CommonObject $error = 0; $datetimeprev = time(); - //Choice the date of the execution direct debit - if (!empty($executiondate)) $datetimeprev = $executiondate; + //Choice the date of the execution direct debit + if (!empty($executiondate)) $datetimeprev = $executiondate; $month = strftime("%m", $datetimeprev); $year = strftime("%Y", $datetimeprev); @@ -929,12 +930,12 @@ class BonPrelevement extends CommonObject // Return warning /*$i=0; - foreach ($this->thirdparty_in_error as $key => $val) - { - if ($i < 10) setEventMessages($val, null, 'warnings'); - else setEventMessages('More error were discarded...', null, 'warnings'); - $i++; - }*/ + foreach ($this->thirdparty_in_error as $key => $val) + { + if ($i < 10) setEventMessages($val, null, 'warnings'); + else setEventMessages('More error were discarded...', null, 'warnings'); + $i++; + }*/ if (count($factures_prev) > 0) { @@ -952,16 +953,16 @@ class BonPrelevement extends CommonObject if ($ok) { /* - * We are in real mode. - * We create withdraw receipt and build withdraw into disk - */ + * We are in real mode. + * We create withdraw receipt and build withdraw into disk + */ $this->db->begin(); $now = dol_now(); /* - * Traitements - */ + * Traitements + */ if (!$error) { $ref = substr($year, -2).$month; @@ -1017,8 +1018,8 @@ class BonPrelevement extends CommonObject if (!$error) { /* - * Create withdrawal receipt in database - */ + * Create withdrawal receipt in database + */ if (count($factures_prev) > 0) { foreach ($factures_prev as $fac) // Add a link in database for each invoice @@ -1027,17 +1028,17 @@ class BonPrelevement extends CommonObject $fact = new Facture($this->db); $fact->fetch($fac[0]); /* - * Add standing order - * - * - * $fac[3] : banque - * $fac[4] : guichet - * $fac[5] : number - * $fac[6] : cle rib - * $fac[7] : amount - * $fac[8] : client nom - * $fac[2] : client id - */ + * Add standing order + * + * + * $fac[3] : banque + * $fac[4] : guichet + * $fac[5] : number + * $fac[6] : cle rib + * $fac[7] : amount + * $fac[8] : client nom + * $fac[2] : client id + */ $ri = $this->AddFacture($fac[0], $fac[2], $fac[8], $fac[7], $fac[3], $fac[4], $fac[5], $fac[6]); if ($ri <> 0) { @@ -1066,8 +1067,8 @@ class BonPrelevement extends CommonObject if (!$error) { /* - * Create direct debit order in a XML file - */ + * Create direct debit order in a XML file + */ dol_syslog(__METHOD__."::Init withdraw receipt for ".count($factures_prev)." invoices", LOG_DEBUG); @@ -1104,8 +1105,8 @@ class BonPrelevement extends CommonObject //var_dump($factures_prev);exit; /* - * Update total - */ + * Update total + */ $sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_bons"; $sql .= " SET amount = ".price2num($this->total); $sql .= " WHERE rowid = ".$this->id; @@ -1118,13 +1119,13 @@ class BonPrelevement extends CommonObject dol_syslog(__METHOD__."::Error update total: ".$this->db->error(), LOG_ERR); } - if (!$error && !$notrigger) - { - // Call trigger - $result = $this->call_trigger('DIRECT_DEBIT_ORDER_CREATE', $user); - if ($result < 0) $error++; - // End call triggers - } + if (!$error && !$notrigger) + { + // Call trigger + $result = $this->call_trigger('DIRECT_DEBIT_ORDER_CREATE', $user); + if ($result < 0) $error++; + // End call triggers + } if (!$error) { @@ -1160,10 +1161,10 @@ class BonPrelevement extends CommonObject if (!$notrigger) { - // Call trigger - $result = $this->call_trigger('DIRECT_DEBIT_ORDER_DELETE', $user); - if ($result < 0) $error++; - // End call triggers + // Call trigger + $result = $this->call_trigger('DIRECT_DEBIT_ORDER_DELETE', $user); + if ($result < 0) $error++; + // End call triggers } if (!$error) @@ -1210,11 +1211,11 @@ class BonPrelevement extends CommonObject /** * Returns clickable name (with picto) * - * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) - * @param string $option On what the link point to ('nolink', ...) - * @param int $notooltip 1=Disable tooltip - * @param string $morecss Add more css on link - * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @return string URL of target */ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) @@ -1280,7 +1281,7 @@ class BonPrelevement extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Delete a notification def by id * @@ -1289,7 +1290,7 @@ class BonPrelevement extends CommonObject */ public function DeleteNotificationById($rowid) { - // phpcs:enable + // phpcs:enable $result = 0; $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def"; @@ -1305,7 +1306,7 @@ class BonPrelevement extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Delete a notification * @@ -1315,7 +1316,7 @@ class BonPrelevement extends CommonObject */ public function DeleteNotification($user, $action) { - // phpcs:enable + // phpcs:enable $result = 0; $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def"; @@ -1331,7 +1332,7 @@ class BonPrelevement extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Add a notification * @@ -1342,7 +1343,7 @@ class BonPrelevement extends CommonObject */ public function AddNotification($db, $user, $action) { - // phpcs:enable + // phpcs:enable $result = 0; if ($this->DeleteNotification($user, $action) == 0) @@ -1376,7 +1377,7 @@ class BonPrelevement extends CommonObject * File is generated with name this->filename * * @param string $format FRST, RCUR or ALL - * @param string $executiondate Date to execute transfer + * @param string $executiondate Date to execute transfer * @return int 0 if OK, <0 if KO */ public function generate($format = 'ALL', $executiondate = '') @@ -1414,7 +1415,7 @@ class BonPrelevement extends CommonObject $dateTime_ECMA = dol_print_date($now, '%Y-%m-%dT%H:%M:%S'); $date_actu = $now; - if (!empty($executiondate)) $date_actu = $executiondate; + if (!empty($executiondate)) $date_actu = $executiondate; $dateTime_YMD = dol_print_date($date_actu, '%Y%m%d'); $dateTime_YMDHMS = dol_print_date($date_actu, '%Y%m%d%H%M%S'); @@ -1554,12 +1555,12 @@ class BonPrelevement extends CommonObject fclose($this->file); if (!empty($conf->global->MAIN_UMASK)) - @chmod($this->file, octdec($conf->global->MAIN_UMASK)); - return $result; + @chmod($this->file, octdec($conf->global->MAIN_UMASK)); + return $result; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Write recipient of request (customer) * @@ -1576,7 +1577,7 @@ class BonPrelevement extends CommonObject */ public function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $ref, $facid, $rib_dom = '') { - // phpcs:enable + // phpcs:enable fputs($this->file, "06"); fputs($this->file, "08"); // Prelevement ordinaire @@ -1647,7 +1648,7 @@ class BonPrelevement extends CommonObject return $pre.'-'.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Write recipient of request (customer) * @@ -1667,15 +1668,15 @@ class BonPrelevement extends CommonObject * @param string $row_bic rib.bic AS bic, * @param string $row_datec rib.datec, * @param string $row_drum rib.rowid used to generate rum - * @param string $row_rum rib.rum Rum defined on company bank account + * @param string $row_rum rib.rum Rum defined on company bank account * @return string Return string with SEPA part DrctDbtTxInf */ public function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_ref, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum, $row_rum) { - // phpcs:enable - global $conf; + // phpcs:enable + global $conf; - include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $CrLf = "\n"; $Rowing = sprintf("%06d", $row_idfac); @@ -1690,7 +1691,7 @@ class BonPrelevement extends CommonObject $XML_DEBITOR = ''; $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; - // $XML_DEBITOR .=' '.('AS-'.dol_trunc($row_ref,20).'-'.$Rowing).''.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters + // $XML_DEBITOR .=' '.('AS-'.dol_trunc($row_ref,20).'-'.$Rowing).''.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters $XML_DEBITOR .= ' '.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('AS-'.dol_trunc($row_ref, 20)).'-'.$Rowing).''.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.round($row_somme, 2).''.$CrLf; @@ -1722,8 +1723,8 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; - // $XML_DEBITOR .=' '.($row_ref.'/'.$Rowing.'/'.$Rum).''.$CrLf; - // $XML_DEBITOR .=' '.dol_trunc($row_ref, 135).''.$CrLf; // 140 max + // $XML_DEBITOR .=' '.($row_ref.'/'.$Rowing.'/'.$Rum).''.$CrLf; + // $XML_DEBITOR .=' '.dol_trunc($row_ref, 135).''.$CrLf; // 140 max $XML_DEBITOR .= ' '.(($conf->global->PRELEVEMENT_USTRD != "") ? $conf->global->PRELEVEMENT_USTRD : dol_trunc($row_ref, 135)).''.$CrLf; // 140 max $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; @@ -1731,7 +1732,7 @@ class BonPrelevement extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Write sender of request (me) * @@ -1739,7 +1740,7 @@ class BonPrelevement extends CommonObject */ public function EnregEmetteur() { - // phpcs:enable + // phpcs:enable fputs($this->file, "03"); fputs($this->file, "08"); // Prelevement ordinaire @@ -1798,7 +1799,7 @@ class BonPrelevement extends CommonObject fputs($this->file, "\n"); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Write sender of request (me). * Note: The tag PmtInf is opened here but closed into caller @@ -1813,7 +1814,7 @@ class BonPrelevement extends CommonObject */ public function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf = '\n', $format = 'FRST') { - // phpcs:enable + // phpcs:enable // SEPA INITIALISATION global $conf; @@ -1892,13 +1893,13 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; /* $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.$this->raison_sociale.''.$CrLf; - $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; - $XML_SEPA_INFO .= ' '.$conf->global->MAIN_INFO_SOCIETE_ADDRESS.''.$CrLf; - $XML_SEPA_INFO .= ' '.$conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN.''.$CrLf; - $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.$CrLf;*/ + $XML_SEPA_INFO .= ' '.$this->raison_sociale.''.$CrLf; + $XML_SEPA_INFO .= ' '.$CrLf; + $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; + $XML_SEPA_INFO .= ' '.$conf->global->MAIN_INFO_SOCIETE_ADDRESS.''.$CrLf; + $XML_SEPA_INFO .= ' '.$conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN.''.$CrLf; + $XML_SEPA_INFO .= ' '.$CrLf; + $XML_SEPA_INFO .= ' '.$CrLf;*/ $XML_SEPA_INFO .= ' SLEV'.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; @@ -1921,7 +1922,7 @@ class BonPrelevement extends CommonObject return $XML_SEPA_INFO; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Write end * @@ -1930,7 +1931,7 @@ class BonPrelevement extends CommonObject */ public function EnregTotal($total) { - // phpcs:enable + // phpcs:enable fputs($this->file, "08"); fputs($this->file, "08"); // Prelevement ordinaire @@ -1995,7 +1996,7 @@ class BonPrelevement extends CommonObject return $this->LibStatut($this->statut, $mode); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return status label for a status * diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index fecc5a96aa1..5bb218d46cd 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -108,6 +108,10 @@ class ChargeSociales extends CommonObject public $fk_project; + const STATUS_UNPAID = 0; + const STATUS_PAID = 1; + + /** * Constructor * @@ -495,43 +499,23 @@ class ChargeSociales extends CommonObject // Load translation files required by the page $langs->loadLangs(array("customers","bills")); - if ($mode == 0 || $mode == 1) + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { - if ($status == 0) return $langs->trans("Unpaid"); - elseif ($status == 1) return $langs->trans("Paid"); - } - elseif ($mode == 2) - { - if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid"); - elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted"); - elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid"); - } - elseif ($mode == 3) - { - if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1'); - elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3'); - elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6'); - } - elseif ($mode == 4) - { - if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid"); - elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted"); - elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid"); - } - elseif ($mode == 5) - { - if ($status == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1'); - elseif ($status == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3'); - elseif ($status == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6'); - } - elseif ($mode == 6) - { - if ($status == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1'); - elseif ($status == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3'); - elseif ($status == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6'); + global $langs; + //$langs->load("mymodule"); + $this->labelStatus[self::STATUS_UNPAID] = $langs->trans('Unpaid'); + $this->labelStatus[self::STATUS_PAID] = $langs->trans('Paid'); + if ($status == 0 && $alreadypaid > 0) $this->labelStatus[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); + $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans('Draft'); + $this->labelStatusShort[self::STATUS_PAID] = $langs->trans('Enabled'); + if ($status == 0 && $alreadypaid > 0) $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); } - else return "Error, mode/status not found"; + $statusType = 'status1'; + if ($status == 0 && $alreadypaid > 0) $statusType = 'status3'; + if ($status == 1) $statusType = 'status6'; + + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 994b71a416d..075ba0efb84 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1260,12 +1260,14 @@ class pdf_einstein extends ModelePDFCommandes { if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; } else { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + $logo = $logodir.'/logos/'.$this->emetteur->logo; } if (is_readable($logo)) { diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 68fa5f179e7..6342cd6ce74 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1393,12 +1393,14 @@ class pdf_eratosthene extends ModelePDFCommandes { if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; } else { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + $logo = $logodir.'/logos/'.$this->emetteur->logo; } if (is_readable($logo)) { diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index f39934a7f65..64aa3c52e25 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1618,12 +1618,14 @@ class pdf_crabe extends ModelePDFFactures { if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; } else { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + $logo = $logodir.'/logos/'.$this->emetteur->logo; } if (is_readable($logo)) { diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index ecaa4ba14a0..3e00e2cab68 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1834,12 +1834,14 @@ class pdf_sponge extends ModelePDFFactures { if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; } else { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + $logo = $logodir.'/logos/'.$this->emetteur->logo; } if (is_readable($logo)) { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 4391c52d482..9219de5863c 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1467,12 +1467,14 @@ class pdf_azur extends ModelePDFPropales { if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; } else { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + $logo = $logodir.'/logos/'.$this->emetteur->logo; } if (is_readable($logo)) { diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index b26b8831f32..1e67ac6485c 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1503,12 +1503,14 @@ class pdf_cyan extends ModelePDFPropales { if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; } else { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + $logo = $logodir.'/logos/'.$this->emetteur->logo; } if (is_readable($logo)) { diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 79c4978b660..a565ecb59b8 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -251,9 +251,9 @@ ShowListTicketWithTrackId=Display ticket list from track ID ShowTicketWithTrackId=Display ticket from track ID TicketPublicDesc=You can create a support ticket or check from an existing ID. YourTicketSuccessfullySaved=Ticket has been successfully saved! -MesgInfosPublicTicketCreatedWithTrackId=A new ticket has been created with ID %s. +MesgInfosPublicTicketCreatedWithTrackId=A new ticket has been created with ID %s and Ref %s. PleaseRememberThisId=Please keep the tracking number that we might ask you later. -TicketNewEmailSubject=Ticket creation confirmation +TicketNewEmailSubject=Ticket creation confirmation - Ref %s TicketNewEmailSubjectCustomer=New support ticket TicketNewEmailBody=This is an automatic email to confirm you have registered a new ticket. TicketNewEmailBodyCustomer=This is an automatic email to confirm a new ticket has just been created into your account. @@ -272,7 +272,7 @@ Subject=Subject ViewTicket=View ticket ViewMyTicketList=View my ticket list ErrorEmailMustExistToCreateTicket=Error: email address not found in our database -TicketNewEmailSubjectAdmin=New ticket created +TicketNewEmailSubjectAdmin=New ticket created - Ref %s TicketNewEmailBodyAdmin=

Ticket has just been created with ID #%s, see information:

SeeThisTicketIntomanagementInterface=See ticket in management interface TicketPublicInterfaceForbidden=The public interface for the tickets was not enabled diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 427217bec10..6a724db9d87 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -105,6 +105,10 @@ class Loan extends CommonObject public $fk_project; + const STATUS_UNPAID = 0; + const STATUS_PAID = 1; + + /** * Constructor * @@ -425,47 +429,29 @@ class Loan extends CommonObject */ public function LibStatut($status, $mode = 0, $alreadypaid = -1) { - // phpcs:enable + // phpcs:enable global $langs; - $langs->loadLangs(array("customers", "bills")); - if ($mode == 0 || $mode == 1) + // Load translation files required by the page + $langs->loadLangs(array("customers","bills")); + + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { - if ($status == 0) return $langs->trans("Unpaid"); - elseif ($status == 1) return $langs->trans("Paid"); - } - elseif ($mode == 2) - { - if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid"); - elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted"); - elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid"); - } - elseif ($mode == 3) - { - if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1'); - elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3'); - elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6'); - } - elseif ($mode == 4) - { - if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid"); - elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted"); - elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid"); - } - elseif ($mode == 5) - { - if ($status == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1'); - elseif ($status == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3'); - elseif ($status == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6'); - } - elseif ($mode == 6) - { - if ($status == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1'); - elseif ($status == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3'); - elseif ($status == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6'); + global $langs; + //$langs->load("mymodule"); + $this->labelStatus[self::STATUS_UNPAID] = $langs->trans('Unpaid'); + $this->labelStatus[self::STATUS_PAID] = $langs->trans('Paid'); + if ($status == 0 && $alreadypaid > 0) $this->labelStatus[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); + $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans('Draft'); + $this->labelStatusShort[self::STATUS_PAID] = $langs->trans('Enabled'); + if ($status == 0 && $alreadypaid > 0) $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); } - else return "Error, mode/status not found"; + $statusType = 'status1'; + if ($status == 0 && $alreadypaid > 0) $statusType = 'status3'; + if ($status == 1) $statusType = 'status6'; + + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index a8192155b63..d1a01cd11b1 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -49,7 +49,8 @@ if (!$sortorder) $sortorder = "DESC"; $search_ref = GETPOST('search_ref', 'int'); $search_label = GETPOST('search_label', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); -$filtre = GETPOST("filtre"); + +$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search $optioncss = GETPOST('optioncss', 'alpha'); // Purge search criteria @@ -77,10 +78,6 @@ $sql .= " WHERE l.entity = ".$conf->entity; if ($search_amount) $sql .= natural_search("l.capital", $search_amount, 1); if ($search_ref) $sql .= " AND l.rowid = ".$db->escape($search_ref); if ($search_label) $sql .= natural_search("l.label", $search_label); -if ($filtre) { - $filtre = str_replace(":", "=", $filtre); - $sql .= " AND ".$filtre; -} $sql .= " GROUP BY l.rowid, l.label, l.capital, l.paid, l.datestart, l.dateend"; $sql .= $db->order($sortfield, $sortorder); @@ -108,10 +105,10 @@ if ($resql) $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); - if ($search_ref) $param.="&search_ref=".urlencode($search_ref); - if ($search_label) $param.="&search_label=".urlencode($search_user); - if ($search_amount) $param.="&search_amount=".urlencode($search_amount_ht); - if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); + if ($search_ref) $param.="&search_ref=".urlencode($search_ref); + if ($search_label) $param.="&search_label=".urlencode($search_label); + if ($search_amount) $param.="&search_amount=".urlencode($search_amount); + if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); $newcardbutton=''; if ($user->rights->loan->write) @@ -130,6 +127,8 @@ if ($resql) print_barre_liste($langs->trans("Loans"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, $newcardbutton, '', $limit); + $moreforfilter = ''; + print '
'; print ''."\n"; @@ -157,7 +156,7 @@ if ($resql) print_liste_field_titre(''); print "\n"; - while ($i < min($num, $limit)) + while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql); $loan_static->id = $obj->rowid; @@ -190,6 +189,14 @@ if ($resql) $i++; } + // If no record found + if ($num == 0) + { + $colspan = 7; + //foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; } + print ''; + } + print "
'.$langs->trans("NoRecordFound").'
"; print '
'; print "\n"; diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index 4410e598204..a951b9c9b0f 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -48,17 +48,17 @@ $linkback = ''; // Ref loan -$morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', 0, 1); -$morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', null, null, '', 1); +$morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'string', '', 0, 1); +$morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1); // Project if (!empty($conf->projet->enabled)) { $langs->loadLangs(array("projects")); - $morehtmlref .= '
'.$langs->trans('Project').' '; + $morehtmlref .= '
'.$langs->trans('Project').' : '; if ($user->rights->loan->write) { if ($action != 'classify') - $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + //$morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); $morehtmlref .= '
'; @@ -83,6 +83,9 @@ if (!empty($conf->projet->enabled)) } } $morehtmlref .= '
'; + +$morehtmlright = ''; + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); if ($action == 'createecheancier') { @@ -140,8 +143,6 @@ if ($action == 'updateecheancier') { $echeance = new LoanSchedule($db); $echeance->fetchAll($object->id); -$var = !$var; - ?>