diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index ddc70d21c85..8329014dfad 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1660,7 +1660,7 @@ class Adherent extends CommonObject */ public function subscription($date, $amount, $accountid = 0, $operation = '', $label = '', $num_chq = '', $emetteur_nom = '', $emetteur_banque = '', $datesubend = 0, $fk_type = null) { - global $conf, $langs, $user; + global $user; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; @@ -1691,6 +1691,10 @@ class Adherent extends CommonObject $subscription->note_public = $label; $subscription->fk_type = $fk_type; + if (empty($subscription->user_creation_id)) { + $subscription->user_creation_id = $user->id; + } + $rowid = $subscription->create($user); if ($rowid > 0) { // Update denormalized subscription end date (read database subscription to find values) diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index f31f75ea7b1..8fa636ca903 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -155,8 +155,6 @@ class Subscription extends CommonObject $this->db->begin(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note)"; - require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; $member = new Adherent($this->db); $result = $member->fetch($this->fk_adherent); @@ -166,11 +164,15 @@ class Subscription extends CommonObject } else { $type = $this->fk_type; } + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note, fk_user_creat)"; $sql .= " VALUES (".((int) $this->fk_adherent).", '".$this->db->escape($type)."', '".$this->db->idate($now)."',"; $sql .= " '".$this->db->idate($this->dateh)."',"; $sql .= " '".$this->db->idate($this->datef)."',"; $sql .= " ".((float) $this->amount).","; - $sql .= " '".$this->db->escape($this->note_public ? $this->note_public : $this->note)."')"; + $sql .= " '".$this->db->escape($this->note_public ? $this->note_public : $this->note)."',"; + $sql .= " ".((int) ($this->user_creation_id > 0 ? $this->user_creation_id : $user->id)); + $sql .= ")"; $resql = $this->db->query($sql); if (!$resql) { @@ -516,8 +518,7 @@ class Subscription extends CommonObject */ public function info($id) { - $sql = 'SELECT c.rowid, c.datec,'; - $sql .= ' c.tms as datem'; + $sql = 'SELECT c.rowid, c.datec, c.tms as datem, c.fk_user_creat'; $sql .= ' FROM '.MAIN_DB_PREFIX.'subscription as c'; $sql .= ' WHERE c.rowid = '.((int) $id); @@ -529,6 +530,8 @@ class Subscription extends CommonObject $this->date_creation = $this->db->jdate($obj->datec); $this->date_modification = $this->db->jdate($obj->datem); + + $this->user_creation_id = $obj->fk_user_creat; } $this->db->free($resql); diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 5a60b07c223..55cde8bd728 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -559,12 +559,12 @@ if ($object->datefin) { print $langs->trans("SubscriptionNotNeeded"); } elseif (!$adht->subscription) { print $langs->trans("SubscriptionNotRecorded"); - if (Adherent::STATUS_VALIDATED == $object->statut) { + if (Adherent::STATUS_VALIDATED == $object->status) { print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft, not excluded and not resiliated } } else { print $langs->trans("SubscriptionNotReceived"); - if (Adherent::STATUS_VALIDATED == $object->statut) { + if (Adherent::STATUS_VALIDATED == $object->status) { print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft, not excluded and not resiliated } } @@ -967,8 +967,8 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h $paymentdate = dol_mktime(0, 0, 0, GETPOSTINT('paymentmonth'), GETPOSTINT('paymentday'), GETPOSTINT('paymentyear')); } - print ''; // Date start subscription + print ''; $currentyear = dol_print_date($now, "%Y"); $currentmonth = dol_print_date($now, "%m"); print ''.$langs->trans("DateSubscription").''; @@ -977,7 +977,10 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h } if (!$datefrom) { // Guess the subscription start date - $datefrom = $object->datevalid; // By default, the subscription start date is the payment date + // By default, the subscription start date is the end date of previous membership ($object->datefin) + 1 day, or the date of + // the validation of the member if no previous date exists. + $datefrom = ($object->datefin ? dol_time_plus_duree($object->datefin, 1, 'd') : $object->datevalid); + if (getDolGlobalString('MEMBER_SUBSCRIPTION_START_AFTER')) { $datefrom = dol_time_plus_duree($now, (int) substr(getDolGlobalString('MEMBER_SUBSCRIPTION_START_AFTER'), 0, -1), substr(getDolGlobalString('MEMBER_SUBSCRIPTION_START_AFTER'), -1)); } elseif ($object->datefin > 0 && dol_time_plus_duree($object->datefin, $defaultdelay, $defaultdelayunit) > $now) { @@ -1015,7 +1018,8 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h if ($adht->subscription) { // Amount - print ''.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency) .''; + print ''.$langs->trans("Amount").''; + print ' '.$langs->trans("Currency".$conf->currency) .''; // Label print ''.$langs->trans("Label").''; diff --git a/htdocs/adherents/subscription/info.php b/htdocs/adherents/subscription/info.php index 96bed86d3a2..e8046dc3f41 100644 --- a/htdocs/adherents/subscription/info.php +++ b/htdocs/adherents/subscription/info.php @@ -80,7 +80,7 @@ print '
'; $object->info($rowid); -print '
'; +print '
'; dol_print_object_info($object); print '
'; diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 0dbe9d5dc4c..174e71a7516 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -127,7 +127,7 @@ print ''; print ''; print ''; -print ''."\n"; +print ''."\n"; // Name of Accountant Company print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyInfo").'
'; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 18b5dff4645..2e1afa189cc 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -444,8 +444,8 @@ print load_fiche_titre($langs->trans("BankColorizeMovement"), '', ''); print '
'; print ''."\n"; print ''."\n"; -print ''; -print ''."\n"; +print ''; +print ''."\n"; print "\n"; print '
'.$langs->trans("Name").''.$langs->trans("Value").''.$langs->trans("Parameter").'
'; diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index a2d261159e0..f425524f3cc 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -450,7 +450,7 @@ print '
'; print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 1c28ed4c482..1c4f0b4377a 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -456,7 +456,7 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; print ''; -print ''; +print ''; print "\n"; print "\n"; diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 49cb87e885c..ba4836f815c 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -92,8 +92,8 @@ print ''; print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; -print ''; -print ''; +print ''; +print ''; print "\n"; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index e3d08bb29cb..68856768f08 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -899,7 +899,7 @@ if ($mysoc->country_code == 'GR') { print '
'.$langs->trans("Name").''.$langs->trans("Value").''.$langs->trans("Parameter").'
'; print ''; print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index cf91b5fb5cb..ae676a142fd 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -497,7 +497,7 @@ print '
'; print '
'.$langs->trans("AccountParameter").''.$langs->trans("Value").'
'; print ''; print ''; -print ''; +print ''; print "\n"; $substitutionarray = pdf_getSubstitutionArray($langs, array('objectamount'), null, 2); diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index 76bfbd63b8f..6099d183348 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -102,7 +102,7 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - print ''; + print ''; foreach ($arrayofparameters as $key => $val) { if (isset($val['enabled']) && empty($val['enabled'])) { @@ -138,7 +138,7 @@ if ($action == 'edit') { print '
'; } else { print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; - print ''; + print ''; foreach ($arrayofparameters as $key => $val) { if (isset($val['enabled']) && empty($val['enabled'])) { diff --git a/htdocs/admin/debugbar.php b/htdocs/admin/debugbar.php index 9d1356362ba..6f77e1ef4e9 100644 --- a/htdocs/admin/debugbar.php +++ b/htdocs/admin/debugbar.php @@ -97,7 +97,7 @@ print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index fe17368d821..092ec5bc5fc 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -249,11 +249,11 @@ if ($action == 'edit') { // Show if meteo is enabled print '
'.$langs->trans("Parameter").''.$langs->trans("Value").''.$langs->trans("Parameter").'
'; - print ''; + print ''; print ''; print ''; print '
'.$langs->trans("Option").''.$langs->trans("Value").'
'.$langs->trans("Option").'
'.$langs->trans("MAIN_DISABLE_METEO").''; - print $form->selectarray('MAIN_DISABLE_METEO', $labelmeteo, (!getDolGlobalString('MAIN_DISABLE_METEO') ? 0 : $conf->global->MAIN_DISABLE_METEO)); + print $form->selectarray('MAIN_DISABLE_METEO', $labelmeteo, getDolGlobalInt('MAIN_DISABLE_METEO')); print '
'; @@ -263,7 +263,7 @@ if ($action == 'edit') { */ print ''; - print ''; + print ''; foreach ($modules as $module => $delays) { if (isModEnabled($module)) { @@ -283,7 +283,7 @@ if ($action == 'edit') { // Show if meteo is enabled print '
'.$langs->trans("DelaysOfToleranceBeforeWarning").''.$langs->trans("Value").'
'.$langs->trans("DelaysOfToleranceBeforeWarning").'
'; - print ''; + print ''; print ''; print '
'.$langs->trans("Option").''.$langs->trans("Value").'
'.$langs->trans("Option").'
'.$langs->trans("MAIN_DISABLE_METEO").''; diff --git a/htdocs/admin/delivery.php b/htdocs/admin/delivery.php index f8d6c1730ad..fa05a39c472 100644 --- a/htdocs/admin/delivery.php +++ b/htdocs/admin/delivery.php @@ -490,7 +490,7 @@ if (getDolGlobalString('MAIN_SUBMODULE_DELIVERY')) { print ''; print ''; print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index b881d6d6a1a..cfc02d93efa 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -96,7 +96,7 @@ print dol_get_fiche_head($head, 'ecm', '', -1, ''); print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; print ''; -print ''."\n"; +print ''."\n"; print ''; // Mail required for members diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index a92affd82cd..51eaededfb0 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -186,7 +186,7 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("Description").''.$langs->trans("Value").'
'; - print ''; + print ''; foreach ($arrayofparameters as $constname => $val) { if ($val['enabled'] == 1) { @@ -269,7 +269,7 @@ if ($action == 'edit') { } else { if (!empty($arrayofparameters)) { print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; - print ''; + print ''; foreach ($arrayofparameters as $constname => $val) { if ($val['enabled'] == 1) { diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 9e04a9894da..edcd0469c1a 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -538,7 +538,7 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print ''; print ''; -print ''; +print ''; print "\n"; print "\n"; diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index 64bc975d3da..20716b351cf 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -110,7 +110,7 @@ print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index 18b7ac33f6d..b6fc587032d 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -461,27 +461,9 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").''.$langs->trans("Parameter").'
'; print ''; print ''; -print ''; +print ''; print "\n"; -//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY); -//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY); -//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY); -//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY); - -if (!isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY)) { - $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY = 1; -} -if (!isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY)) { - $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY = 1; -} - -//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY); -//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY); -//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY); -//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY); - - // Set working days print ''; print ""; diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index 6671a5b68ad..e80962f6d25 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -510,7 +510,7 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
".$langs->trans("XIsAUsualNonWorkingDay", $langs->transnoentitiesnoconv("Monday"))."
'; - print ''; + print ''; foreach ($arrayofparameters as $constname => $val) { if ($val['enabled'] == 1) { @@ -595,7 +595,7 @@ if ($action == 'edit') { } else { if (!empty($arrayofparameters)) { print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; - print ''; + print ''; foreach ($arrayofparameters as $constname => $val) { if ($val['enabled'] == 1) { diff --git a/htdocs/admin/invoice.php b/htdocs/admin/invoice.php index 736078cd4cf..e9dc88c9b96 100644 --- a/htdocs/admin/invoice.php +++ b/htdocs/admin/invoice.php @@ -792,7 +792,7 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; @@ -879,7 +879,7 @@ print '
'; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").' 
'."\n"; print ''."\n"; print ''."\n"; -print ''."\n"; +print ''."\n"; print "\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php index ffd63bb379c..7c7458a6901 100644 --- a/htdocs/admin/knowledgemanagement.php +++ b/htdocs/admin/knowledgemanagement.php @@ -217,7 +217,7 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("Name").''.$langs->trans("Value").'
'.$langs->trans("PathDirectory").'
'; - print ''; + print ''; // @phan-suppress-next-line PhanEmptyForeach foreach ($arrayofparameters as $constname => $val) { @@ -285,7 +285,7 @@ if ($action == 'edit') { } else { if (!empty($arrayofparameters)) { print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; - print ''; + print ''; // @phan-suppress-next-line PhanEmptyForeach foreach ($arrayofparameters as $constname => $val) { diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index c7c55268b4b..2fb95d6e572 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -198,7 +198,7 @@ print $hookmanager->resPrint; print ''; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index a3e9b993621..164a0ce525c 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -173,7 +173,7 @@ if ($action == 'edit') { clearstatcache(); print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'.$langs->trans("Parameter").''.$langs->trans("Value").''.$langs->trans("Example").'
'; - print ''; + print ''; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"), $langs->trans("ParameterActiveForNextInputOnly")); @@ -204,7 +204,7 @@ if ($action == 'edit') { } else { print '
'; print ''; - print ''; + print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"), $langs->trans("ParameterActiveForNextInputOnly")); diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 36b8553156e..73a0787486b 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -144,7 +144,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/mails_ingoing.php b/htdocs/admin/mails_ingoing.php index 734d83f619c..a206f4bed29 100644 --- a/htdocs/admin/mails_ingoing.php +++ b/htdocs/admin/mails_ingoing.php @@ -118,7 +118,7 @@ print "

\n"; /* print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print '
'.$langs->trans("Parameter").''.$langs->trans("Value").''.$langs->trans("Example").'
'; -print ''; +print ''; print '
'; diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php index bf7c39d8b9a..0b343459e3d 100644 --- a/htdocs/admin/mrp.php +++ b/htdocs/admin/mrp.php @@ -450,7 +450,7 @@ print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print ''; print ''; -print ''; +print ''; print "\n"; print "\n"; diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index d9a9ae5bbfc..7bf96c88081 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -202,7 +202,7 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; print ''; -print ''; +print ''; print "\n"; diff --git a/htdocs/admin/openinghours.php b/htdocs/admin/openinghours.php index 67289748f37..f79b92a7949 100644 --- a/htdocs/admin/openinghours.php +++ b/htdocs/admin/openinghours.php @@ -107,37 +107,37 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit') { print ''."\n"; + print ''."\n"; print ''."\n"; + print ''."\n"; print ''."\n"; + print ''."\n"; print ''."\n"; + print ''."\n"; print ''."\n"; + print ''."\n"; print ''."\n"; + print ''."\n"; print ''."\n"; + print ''."\n"; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print $form->textwithpicto($langs->trans("Monday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print '
'; print $form->textwithpicto($langs->trans("Tuesday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print '
'; print $form->textwithpicto($langs->trans("Wednesday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print '
'; print $form->textwithpicto($langs->trans("Thursday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print '
'; print $form->textwithpicto($langs->trans("Friday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print '
'; print $form->textwithpicto($langs->trans("Saturday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print '
'; print $form->textwithpicto($langs->trans("Sunday"), $langs->trans("OpeningHoursFormatDesc")); print ''; - print '
'; diff --git a/htdocs/admin/order.php b/htdocs/admin/order.php index d915eda1693..38b4dd721cf 100644 --- a/htdocs/admin/order.php +++ b/htdocs/admin/order.php @@ -649,7 +649,7 @@ print '
'; print ''; print ''; print ''; -print ''; +print ''; print "\n"; print "\n"; diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index c37c008ad9c..f60bed8f0c9 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -265,7 +265,7 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index a4771a9013b..3d5fb00b6ac 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -162,7 +162,7 @@ print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; print ''; -print ''; +print ''; print ""; // Bank account (from Banks module) @@ -445,7 +445,7 @@ if (isModEnabled('notification')) print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print ''; print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 6101cdcc7bf..02521e57b9e 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -306,7 +306,7 @@ print load_fiche_titre($langs->trans("DictionaryPaperFormat"), '', ''); print '
'; print '
'.$langs->trans("User").''.$langs->trans("Value").''.$langs->trans("Action").'
'; -print ''; +print ''; $selected = getDolGlobalString('MAIN_PDF_FORMAT'); if (empty($selected)) { @@ -515,7 +515,7 @@ print load_fiche_titre($langs->trans("Other"), '', ''); print '
'; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; -print ''; +print ''; // Use 2 languages into PDF diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 73fea915995..73b4d52596c 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -214,7 +214,7 @@ if (isModEnabled('propal')) { print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; - print ''; + print ''; /* This feature seems not yet used into Dolibarr. So option is kept hidden and enabled by default print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; @@ -256,11 +256,12 @@ if (isModEnabled('propal')) { } if (isModEnabled('order')) { - print load_fiche_titre($langs->trans("Orders"), '', 'bill'); + $langs->load("orders"); + print load_fiche_titre($langs->trans('CustomersOrders'), '', 'order'); print '
'; print ''; - print ''; + print ''; print ''; - print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; @@ -271,19 +272,8 @@ if (isModEnabled('order')) { print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_ORDER); } print '
'; - print '
'; -} -if (isModEnabled('order')) { - $langs->load("orders"); - print load_fiche_titre($langs->trans('CustomersOrders'), '', 'order'); - - print '
'; - print ''; - print ''; - - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; print $form->textwithpicto($langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESS"), $langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESSMore")); print ''; if ($conf->use_javascript_ajax) { @@ -305,7 +295,7 @@ if (isModEnabled('supplier_proposal')) { print '
'; print ''; - print ''; + print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"), ''); @@ -340,7 +330,7 @@ if (isModEnabled('supplier_order')) { print '
'; print ''; - print ''; + print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"), ''); @@ -373,7 +363,7 @@ if (isModEnabled('invoice')) { print '
'; print ''; - print ''; + print ''; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_INVOICE"), $langs->trans("PdfAddTermOfSaleHelp")); @@ -489,7 +479,7 @@ if (isModEnabled('shipping')) { print '
'; print ''; - print ''; + print ''; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; print $langs->trans("BARCODE_ON_SHIPPING_PDF"); @@ -511,7 +501,7 @@ if (isModEnabled('reception')) { print '
'; print ''; - print ''; + print ''; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; print $langs->trans("RECEPTION_PDF_HIDE_ORDERED"); @@ -554,7 +544,7 @@ if (isModEnabled('stocktransfer')) { print '
'; print ''; - print ''; + print ''; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; print $langs->trans("BARCODE_ON_STOCKTRANSFER_PDF"); @@ -574,7 +564,7 @@ if (isModEnabled('stocktransfer')) { print load_fiche_titre($langs->trans("Files"), '', 'file'); print '
'; print ''; -print ''; +print ''; // Terms of sale $tooltiptermsofsale = $langs->trans('AvailableFormats').' : pdf'; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 90a150ba6bc..50a5430df3e 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -164,7 +164,7 @@ print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; print ''; print ''; -print ''; +print ''; print ""; @@ -460,7 +460,7 @@ if (isModEnabled('notification') ) print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print ''; print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index aac4c03bfb4..7b16c42eb81 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -88,7 +88,7 @@ print '
'; print '
'.$langs->trans("User").''.$langs->trans("Value").''.$langs->trans("Action").'
'; print ''; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''; diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index ad815dc5bc8..15bbe9a6691 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -181,7 +181,7 @@ if ($action == 'edit') { clearstatcache(); print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; - print ''; + print ''; // Disable print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'.$langs->trans("MAIN_DISABLE_ALL_SMS").''; @@ -217,7 +217,7 @@ if ($action == 'edit') { print '
'; } else { print ''; - print ''; + print ''; // Disable print ''; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 78590db9795..952bccf2074 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -697,7 +697,7 @@ print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'.$langs->trans("MAIN_DISABLE_ALL_SMS").''.yn(getDolGlobalString('MAIN_DISABLE_ALL_SMS')).'
'; print ''; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; print ''; diff --git a/htdocs/admin/stocktransfer.php b/htdocs/admin/stocktransfer.php index e1281c1bf58..6a14e25c466 100644 --- a/htdocs/admin/stocktransfer.php +++ b/htdocs/admin/stocktransfer.php @@ -192,7 +192,7 @@ print ''.$langs->trans("StockTransferSetupPage").''; print '
".$langs->trans("Parameter")."'.$langs->trans("Value").'
'; - print ''; + print ''; foreach ($arrayofparameters as $key => $val) { @@ -213,7 +213,7 @@ print ''.$langs->trans("StockTransferSetupPage").''; - print ''; + print ''; foreach ($arrayofparameters as $key => $val) { diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 325378332ce..8dab80b8157 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -472,7 +472,7 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 17aa2f5f78f..ba4886573f3 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -477,7 +477,7 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index b76fe11f1bd..3419f734977 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -454,7 +454,7 @@ print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index fac147f09d4..2a922fbd752 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -217,7 +217,7 @@ print '
'; // You can use div-table-resp print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; @@ -309,7 +309,7 @@ print ''; print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print '
'.$langs->trans("Type").''.$langs->trans("Value").'
'; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 77ff2b03096..d70217c985e 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -180,7 +180,7 @@ if (empty($mysoc->tva_assuj)) { print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print '
'.$langs->trans("Parameter").''.$langs->trans("Value").''.$langs->trans("Parameter").'
'; - print ''; + print ''; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").'
'; print ''; diff --git a/htdocs/admin/webhook.php b/htdocs/admin/webhook.php index 382971d9906..a4451fec911 100644 --- a/htdocs/admin/webhook.php +++ b/htdocs/admin/webhook.php @@ -182,7 +182,7 @@ if ($action == 'edit') { print ''; print ''; - print ''; + print ''; // @phan-suppress-next-line PhanEmptyForeach foreach ($arrayofparameters as $constname => $val) { @@ -273,7 +273,7 @@ if ($action == 'edit') { } else { if (!empty($arrayofparameters)) { print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; - print ''; + print ''; foreach ($arrayofparameters as $constname => $val) { if ($val['enabled'] == 1) { diff --git a/htdocs/admin/website_options.php b/htdocs/admin/website_options.php index e41ccdf90c7..4cb3f9c6120 100644 --- a/htdocs/admin/website_options.php +++ b/htdocs/admin/website_options.php @@ -128,7 +128,7 @@ print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").'
'; print ''; print ''; print ''; -print ''."\n"; +print ''."\n"; print ''; diff --git a/htdocs/admin/workstation.php b/htdocs/admin/workstation.php index f05467d68da..dc6017c33ed 100644 --- a/htdocs/admin/workstation.php +++ b/htdocs/admin/workstation.php @@ -185,57 +185,6 @@ print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); $head = workstationAdminPrepareHead(); print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, "workstation"); -// Setup page goes here -//echo ''.$langs->trans("WorkstationSetupPage").'

'; - - -if ($action == 'edit') { - print ''; - print ''; - print ''; - - print '
'.$langs->trans("Parameter").' '.$langs->trans("Value").'
'; - print ''; - - // @phan-suppress-next-line PhanEmptyForeach - foreach ($arrayofparameters as $key => $val) { - print ''; - } - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - $tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : ''); - print $form->textwithpicto($langs->trans($key), $tooltiphelp); - print '
'; - - print '
'; - print ''; - print '
'; - - print ''; - print '
'; -} else { - if (!empty($arrayofparameters)) { - print ''; - print ''; - - foreach ($arrayofparameters as $key => $val) { - $setupnotempty++; - - print ''; - } - - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - $tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : ''); - print $form->textwithpicto($langs->trans($key), $tooltiphelp); - print ''.getDolGlobalString($key).'
'; - - print '
'; - print ''.$langs->trans("Modify").''; - print '
'; - }/* else { - print '
'.$langs->trans("NothingToSetup"); - }*/ -} - foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if ($myTmpObjectArray['includerefgeneration']) { diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index a96ec4e0e82..6eb05106686 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1883,7 +1883,7 @@ class ActionComm extends CommonObject $color = 'style="color: #'.$this->type_color.' !important;"'; } if ($this->type_picto) { - $imgpicto = img_picto($titlealt, $this->type_picto, '', 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); + $imgpicto = img_picto($titlealt.'rr', $this->type_picto, '', 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); } else { if ($this->type_code == 'AC_RDV') { $imgpicto = img_picto($titlealt, 'meeting', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); @@ -1891,7 +1891,7 @@ class ActionComm extends CommonObject $imgpicto = img_picto($titlealt, 'object_phoning', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); } elseif ($this->type_code == 'AC_FAX') { $imgpicto = img_picto($titlealt, 'object_phoning_fax', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); - } elseif ($this->type_code == 'AC_EMAIL' || $this->type_code == 'AC_EMAIL_IN' || (!empty($this->code) && preg_match('/_SENTBYMAIL/', $this->code))) { + } elseif ($this->type_code == 'AC_EMAIL' || $this->type_code == 'AC_EMAIL_IN' || $this->type_code == 'AC_EMAILING' || (!empty($this->code) && preg_match('/_SENTBYMAIL/', $this->code))) { $imgpicto = img_picto($titlealt, 'object_email', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); } elseif ($this->type_code == 'AC_INT') { $imgpicto = img_picto($titlealt, 'object_intervention', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 9c28468c1c7..db3fcfe1bbc 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -163,11 +163,13 @@ class CActionComm global $langs, $conf, $user; $langs->load("commercial"); + /* $actionstatic = new ActionComm($this->db); $rep_id = array(); $rep_code = array(); $rep_all = array(); + */ $sql = "SELECT id, code, libelle as label, module, type, color, picto"; $sql .= " FROM ".MAIN_DB_PREFIX."c_actioncomm"; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index b36538b2a68..0920ddae516 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -799,7 +799,7 @@ if ($action == 'create') { // aaa // Print mail form print load_fiche_titre($langs->trans("NewMailing"), $availablelink, 'object_email'); - print dol_get_fiche_head(array(), '', '', -4, '', 0, '', ''); + print dol_get_fiche_head(array(), '', '', 0, '', 0, '', ''); print ''; @@ -831,17 +831,21 @@ if ($action == 'create') { // aaa } print '
'; - print '

'; + print '
'; print ''; - print ''; + print ''; + print ''; - print ''; + print ''; + print ''; - print ''; + print ''; + print ''; - print ''; + print ''; + print ''; // Other attributes $parameters = array(); @@ -852,7 +856,8 @@ if ($action == 'create') { // aaa } print '
'.$langs->trans("MailFrom").'
'.$langs->trans("MailFrom").''.img_picto('', 'email', 'class="pictofixedwidth"').'
'.$langs->trans("MailErrorsTo").'
'.$langs->trans("MailErrorsTo").''.img_picto('', 'email', 'class="pictofixedwidth"').'
'.$langs->trans("MailReply").'
'.$langs->trans("MailReply").''.img_picto('', 'email', 'class="pictofixedwidth"').'
'; - print '

'; + + print '
'; print ''; print ''; @@ -889,7 +894,7 @@ if ($action == 'create') { // aaa print '
'; // wysiwyg editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtmlallowunvalid'), '', 600, 'dolibarr_mailings', '', true, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '90%'); + $doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtmlallowunvalid'), '', 600, 'dolibarr_mailings', '', true, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '100%'); $doleditor->Create(); print '
'; @@ -1129,7 +1134,7 @@ if ($action == 'create') { // aaa } print $text; if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'default') { - if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'mail') { + if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') && getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'mail') { print ' ('.getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING', getDolGlobalString('MAIN_MAIL_SMTP_SERVER')).')'; } } elseif (getDolGlobalString('MAIN_MAIL_SENDMODE') != 'mail' && getDolGlobalString('MAIN_MAIL_SMTP_SERVER')) { @@ -1329,7 +1334,7 @@ if ($action == 'create') { // aaa $readonly = 1; // wysiwyg editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', false, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '90%', $readonly); + $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', false, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '100%', $readonly); $doleditor->Create(); } else { print dol_htmlentitiesbr($object->body); @@ -1548,19 +1553,19 @@ if ($action == 'create') { // aaa if ($action == 'edit') { // wysiwyg editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '90%'); + $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '100%'); $doleditor->Create(); } if ($action == 'edittxt') { // wysiwyg editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, 0, 20, '90%'); + $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, 0, 20, '100%'); $doleditor->Create(); } if ($action == 'edithtml') { // HTML source editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, 'ace', 20, '90%'); + $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, 'ace', 20, '100%'); $doleditor->Create(0, '', false, 'HTML Source', 'php'); } diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index ce1ef8fbcce..ed5e64a5a39 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -476,7 +476,7 @@ if ($object->fetch($id) >= 0) { } print $text; if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'default') { - if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'mail') { + if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') && getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'mail') { print ' ('.getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING', getDolGlobalString('MAIN_MAIL_SMTP_SERVER')).')'; } } elseif (getDolGlobalString('MAIN_MAIL_SENDMODE') != 'mail' && getDolGlobalString('MAIN_MAIL_SMTP_SERVER')) { @@ -678,7 +678,7 @@ if ($object->fetch($id) >= 0) { print '
'; } - print '
'; + print '

'; } // List of selected targets diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index a78da69017f..5f6870d177d 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -497,7 +497,7 @@ class Propal extends CommonObject $localtax2_tx = get_localtax($tva_tx, 2, $mysoc, $this->thirdparty, $tva_npr); // multiprices - if ($conf->global->PRODUIT_MULTIPRICES && $this->thirdparty->price_level) { + if (getDolGlobalString('PRODUIT_MULTIPRICES') && $this->thirdparty->price_level) { $price = $prod->multiprices[$this->thirdparty->price_level]; } else { $price = $prod->price; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 474c50a7ff7..469100ff4c8 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1813,7 +1813,7 @@ class Commande extends CommonOrder $localtax2_tx = get_localtax($tva_tx, 2, $this->thirdparty, $mysoc, $tva_npr); // multiprix - if ($conf->global->PRODUIT_MULTIPRICES && $this->thirdparty->price_level) { + if (getDolGlobalString('PRODUIT_MULTIPRICES') && $this->thirdparty->price_level) { $price = $prod->multiprices[$this->thirdparty->price_level]; } else { $price = $prod->price; diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 2005e7d0fb2..5ccd1ffa2d8 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -1,12 +1,12 @@ - * Copyright (C) 2004-2019 Laurent Destailleur - * Copyright (C) 2017 Pierre-Henry Favre - * Copyright (C) 2020 Maxime DEMAREST - * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2022-2024 Alexandre Spangaro +/* Copyright (C) 2001-2006 Rodolphe Quiedeville + * Copyright (C) 2004-2019 Laurent Destailleur + * Copyright (C) 2017 Pierre-Henry Favre + * Copyright (C) 2020 Maxime DEMAREST + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2022-2025 Alexandre Spangaro * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 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 @@ -622,7 +622,7 @@ $charge_sociales = new ChargeSociales($db); $various_payment = new PaymentVarious($db); $payment_loan = new PaymentLoan($db); -$title = $langs->trans("ComptaFiles").' - '.$langs->trans("List"); +$title = $langs->trans("AccountantFiles").' - '.$langs->trans("List"); $help_url = ''; llxHeader('', $title, $help_url); diff --git a/htdocs/core/ajax/mailtemplate.php b/htdocs/core/ajax/mailtemplate.php index 41054250305..fd6981b8c7f 100644 --- a/htdocs/core/ajax/mailtemplate.php +++ b/htdocs/core/ajax/mailtemplate.php @@ -73,16 +73,17 @@ if (GETPOSTISSET('content')) { foreach ($selectedPosts as $postId) { $post = getNewsDetailsById($postId); + $newsList .= '
-

' . htmlentities($post['title']) . '

-

' . htmlentities($post['description']) . '

- Created By: ' . htmlentities($post['user_fullname']) . ' +

' . htmlentities(empty($post['title']) ? '' : $post['title']) . '

+

' . htmlentities(empty($post['description']) ? '' : $post['description']) . '

+ Created By: ' . htmlentities(empty($post['user_fullname']) ? '' : $post['user_fullname']) . '
- ' . dol_print_date($post['date_creation'], 'daytext', 'tzserver', $langs) . ' + ' . dol_print_date((empty($post['date_creation']) ? dol_now() : $post['date_creation']), 'daytext', 'tzserver', $langs) . '
- ' . ($post['image'] ? 'Image' : 'Gray rectangle') . ' + ' . (!empty($post['image']) ? 'Image' : 'Gray rectangle') . '
'; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e4ab9a505d1..227bcf8775a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6114,9 +6114,10 @@ abstract class CommonObject * @todo Move this into files.lib.php * * @param string $file Path file in UTF8 to original file to create thumbs from. + * @param int $quality Quality after compression (0=worst so better compression, 100=best so low or no compression). For thumbs, we force quality to 50 by default. * @return void */ - public function addThumbs($file) + public function addThumbs($file, $quality = 50) { $file_osencoded = dol_osencode($file); @@ -6129,7 +6130,6 @@ abstract class CommonObject $maxwidthmini = $tmparraysize['maxwidthmini']; $maxheightmini = $tmparraysize['maxheightmini']; //$quality = $tmparraysize['quality']; - $quality = 50; // For thumbs, we force quality to 50 // Create small thumbs for company (Ratio is near 16/9) // Used on logon for example diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index c234a15a374..5bac1782b68 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -20,7 +20,6 @@ * along with this program. If not, see . */ - /** * \file htdocs/core/class/conf.class.php * \ingroup core @@ -1038,6 +1037,14 @@ class Conf extends stdClass $this->global->MAIN_MAX_DECIMALS_SHOWN = 8; } + // Non working days + if (!isset($this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY)) { + $this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY = 1; + } + if (!isset($this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY)) { + $this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY = 1; + } + // Default pdf option if (!isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) { $this->global->MAIN_PDF_DASH_BETWEEN_LINES = 1; // use dash between lines @@ -1134,10 +1141,10 @@ class Conf extends stdClass // Avoid strict errors. TODO: Replace xxx->warning_delay with a property ->warning_delay_xxx if (isset($this->agenda)) { $this->adherent->subscription = new stdClass(); - $this->adherent->subscription->warning_delay = (isset($this->global->MAIN_DELAY_MEMBERS) ? (int) $this->global->MAIN_DELAY_MEMBERS : 0) * 86400; + $this->adherent->subscription->warning_delay = getDolGlobalInt('MAIN_DELAY_MEMBERS') * 86400; } if (isset($this->agenda)) { - $this->agenda->warning_delay = (isset($this->global->MAIN_DELAY_ACTIONS_TODO) ? (int) $this->global->MAIN_DELAY_ACTIONS_TODO : 7) * 86400; + $this->agenda->warning_delay = getDolGlobalInt('MAIN_DELAY_ACTIONS_TODO', 7) * 86400; } if (isset($this->projet)) { $this->projet->warning_delay = (getDolGlobalInt('MAIN_DELAY_PROJECT_TO_CLOSE', 7) * 86400); @@ -1148,46 +1155,46 @@ class Conf extends stdClass if (isset($this->commande)) { $this->commande->client = new stdClass(); $this->commande->fournisseur = new stdClass(); - $this->commande->client->warning_delay = (isset($this->global->MAIN_DELAY_ORDERS_TO_PROCESS) ? (int) $this->global->MAIN_DELAY_ORDERS_TO_PROCESS : 2) * 86400; - $this->commande->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS) ? (int) $this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS : 7) * 86400; + $this->commande->client->warning_delay = getDolGlobalInt('MAIN_DELAY_ORDERS_TO_PROCESS', 2) * 86400; + $this->commande->fournisseur->warning_delay = getDolGlobalInt('MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS', 7) * 86400; } if (isset($this->propal)) { $this->propal->cloture = new stdClass(); $this->propal->facturation = new stdClass(); - $this->propal->cloture->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_CLOSE) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_CLOSE : 0) * 86400; - $this->propal->facturation->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_BILL) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_BILL : 0) * 86400; + $this->propal->cloture->warning_delay = getDolGlobalInt('MAIN_DELAY_PROPALS_TO_CLOSE') * 86400; + $this->propal->facturation->warning_delay = getDolGlobalInt('MAIN_DELAY_PROPALS_TO_BILL') * 86400; } if (isset($this->facture)) { $this->facture->client = new stdClass(); $this->facture->fournisseur = new stdClass(); - $this->facture->client->warning_delay = (isset($this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED) ? (int) $this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED : 0) * 86400; - $this->facture->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY) ? (int) $this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY : 0) * 86400; + $this->facture->client->warning_delay = getDolGlobalInt('MAIN_DELAY_CUSTOMER_BILLS_UNPAYED') * 86400; + $this->facture->fournisseur->warning_delay = getDolGlobalInt('MAIN_DELAY_SUPPLIER_BILLS_TO_PAY') * 86400; } if (isset($this->contrat)) { $this->contrat->services = new stdClass(); $this->contrat->services->inactifs = new stdClass(); $this->contrat->services->expires = new stdClass(); - $this->contrat->services->inactifs->warning_delay = (isset($this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES) ? (int) $this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES : 0) * 86400; - $this->contrat->services->expires->warning_delay = (isset($this->global->MAIN_DELAY_RUNNING_SERVICES) ? (int) $this->global->MAIN_DELAY_RUNNING_SERVICES : 0) * 86400; + $this->contrat->services->inactifs->warning_delay = getDolGlobalInt('MAIN_DELAY_NOT_ACTIVATED_SERVICES') * 86400; + $this->contrat->services->expires->warning_delay = getDolGlobalInt('MAIN_DELAY_RUNNING_SERVICES') * 86400; } if (isset($this->commande)) { $this->bank->rappro = new stdClass(); $this->bank->cheque = new stdClass(); - $this->bank->rappro->warning_delay = (isset($this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE) ? (int) $this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE : 0) * 86400; - $this->bank->cheque->warning_delay = (isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT) ? (int) $this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT : 0) * 86400; + $this->bank->rappro->warning_delay = getDolGlobalInt('MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE') * 86400; + $this->bank->cheque->warning_delay = getDolGlobalInt('MAIN_DELAY_CHEQUES_TO_DEPOSIT') * 86400; } if (isset($this->expensereport)) { $this->expensereport->approve = new stdClass(); - $this->expensereport->approve->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS : 0) * 86400; + $this->expensereport->approve->warning_delay = getDolGlobalInt('MAIN_DELAY_EXPENSEREPORTS') * 86400; $this->expensereport->payment = new stdClass(); - $this->expensereport->payment->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY : 0) * 86400; + $this->expensereport->payment->warning_delay = getDolGlobalInt('MIN_DELAY_EXPENSEREPORTS_TO_PAY') * 86400; } if (isset($this->holiday)) { $this->holiday->approve = new stdClass(); - $this->holiday->approve->warning_delay = (isset($this->global->MAIN_DELAY_HOLIDAYS) ? (int) $this->global->MAIN_DELAY_HOLIDAYS : 0) * 86400; + $this->holiday->approve->warning_delay = getDolGlobalInt('MAIN_DELAY_HOLIDAYS') * 86400; } - if ((!empty($this->global->PRODUIT_MULTIPRICES) || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT)) { + if ((getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT')) { $this->global->PRODUIT_MULTIPRICES_LIMIT = 5; } @@ -1197,10 +1204,10 @@ class Conf extends stdClass // For modules that want to disable top or left menu if (!empty($this->global->MAIN_HIDE_TOP_MENU)) { - $this->dol_hide_topmenu = $this->global->MAIN_HIDE_TOP_MENU; + $this->dol_hide_topmenu = getDolGlobalString('MAIN_HIDE_TOP_MENU'); } if (!empty($this->global->MAIN_HIDE_LEFT_MENU)) { - $this->dol_hide_leftmenu = $this->global->MAIN_HIDE_LEFT_MENU; + $this->dol_hide_leftmenu = getDolGlobalString('MAIN_HIDE_LEFT_MENU'); } if (empty($this->global->MAIN_SIZE_SHORTLIST_LIMIT)) { diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 00c1a3bf98e..c95f857a4a9 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1437,7 +1437,7 @@ class FormFile //var_dump($sortfield.' - '.$sortorder); if ($sortfield && $sortorder) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name) - $filearray = dol_sort_array($filearray, $sortfield, $sortorder); + $filearray = dol_sort_array($filearray, $sortfield, $sortorder, 1); } } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 3f09d2816f7..21f064ba8ca 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1693,7 +1693,7 @@ class FormMail extends Form // Use the multiselect array function to create the dropdown $out .= ''; $out .= '"; } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index aa46e7ccf0b..1c0d5a61aea 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -169,6 +169,7 @@ $ErrorCode = $ErrorShortMsg = $ErrorLongMsg = $ErrorSeverityCode = ''; $object = new stdClass(); // For triggers +/** @var CommonObject $object */ $error = 0; diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 0a2c982258d..e04053634d7 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -178,14 +178,14 @@ top_httphead(); dol_syslog("***** Stripe IPN was called with event->type=".$event->type." service=".$service); -if ($event->type == 'payout.created') { - // When a payout is create by Stripe to transfer money to your account +if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_PAYOUT')) { + // When a payout is created by Stripe to transfer money to your account $error = 0; $result = dolibarr_set_const($db, $service."_NEXTPAYOUT", date('Y-m-d H:i:s', $event->data->object->arrival_date), 'chaine', 0, '', $conf->entity); if ($result > 0) { - $subject = $societeName.' - [NOTIFICATION] Stripe payout scheduled'; + $subject = '['.$societeName.'] Notification - Stripe payout scheduled'; if (!empty($user->email)) { $sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">"; } else { @@ -221,7 +221,7 @@ if ($event->type == 'payout.created') { http_response_code(500); return -1; } -} elseif ($event->type == 'payout.paid') { +} elseif ($event->type == 'payout.paid' && getDolGlobalString('STRIPE_AUTO_RECORD_PAYOUT')) { // When a payout to transfer money to your account is completely done $error = 0; $result = dolibarr_set_const($db, $service."_NEXTPAYOUT", 0, 'chaine', 0, '', $conf->entity); @@ -249,6 +249,8 @@ if ($event->type == 'payout.created') { $typefrom = 'PRE'; $typeto = 'VIR'; + $db->begin(); + if (!$error) { $bank_line_id_from = $accountfrom->addline($dateo, $typefrom, $label, -1 * (float) price2num($amount), '', '', $user); } @@ -274,38 +276,47 @@ if ($event->type == 'payout.created') { if (!($result > 0)) { $error++; } + + if (!$error) { + $db->commit(); + } else { + $db->rollback(); + } + + // Send email + if (!$error) { + $subject = '['.$societeName.'] - NotificationOTIFICATION] Stripe payout done'; + if (!empty($user->email)) { + $sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">"; + } else { + $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '" <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; + } + $replyto = $sendto; + $sendtocc = ''; + if (getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL')) { + $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL') . '" <' . getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; + } + + $message = "A bank transfer of ".price2num($event->data->object->amount / 100)." ".$event->data->object->currency." has been done to your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour'); + + $mailfile = new CMailFile( + $subject, + $sendto, + $replyto, + $message, + array(), + array(), + array(), + $sendtocc, + '', + 0, + -1 + ); + + $ret = $mailfile->sendfile(); + } } - $subject = $societeName.' - [NOTIFICATION] Stripe payout done'; - if (!empty($user->email)) { - $sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">"; - } else { - $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '" <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; - } - $replyto = $sendto; - $sendtocc = ''; - if (getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL')) { - $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL') . '" <' . getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; - } - - $message = "A bank transfer of ".price2num($event->data->object->amount / 100)." ".$event->data->object->currency." has been done to your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour'); - - $mailfile = new CMailFile( - $subject, - $sendto, - $replyto, - $message, - array(), - array(), - array(), - $sendtocc, - '', - 0, - -1 - ); - - $ret = $mailfile->sendfile(); - return 1; } else { $error++; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index fd29d86a584..7d3568eb687 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1551,7 +1551,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print ''; print ''; - print '
'; + print ''; + // Supplier code if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) { if ($conf->browser->layout == 'phone') { print ''; print ''; } - print ''; - print '
'.$langs->trans("MailTopic").'
'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).''; + // Customer code + print '
'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).''; print '
'; $tmpcode = $object->code_client; if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { @@ -1564,14 +1566,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print '
'; print '
'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).''; - print ''; + print '
'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).''; + print ''; - print ''; + if ($conf->browser->layout != 'phone') { + print ''; + } + print ''; print ''; - print '
'; $tmpcode = $object->code_fournisseur; if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { $tmpcode = $modCodeFournisseur->getNextValue($object, 1); @@ -2332,8 +2334,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // Nature of thirdparty $selectedprospect = (GETPOSTISSET('prospect') ? GETPOSTINT('prospect') : $selectedprospect); $selectedcustomer = (GETPOSTISSET('customer') ? GETPOSTINT('customer') : $selectedcustomer); - print '
'.$form->editfieldkey('', 'customerprospect', '', $object, 0, 'string', '', 0).''; + print '
'.$form->editfieldkey('', 'customerprospect', '', $object, 0, 'string', '', 0).'browser->layout != 'phone' ? 'colspan="3"' : 'colspan="2"').'>'; if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS')) { print ''; @@ -2393,7 +2398,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } print '
'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).''; + + print '
'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).''; print ''; } - print '
'; $tmpcode = $object->code_client; if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { @@ -2410,7 +2416,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print '
'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).''; + print ''.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).''; if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) { print 'browser->layout == 'phone' ? '' : ' colspan="3"').'>'; print $form->selectarray('status', array('0' => $langs->trans('ActivityCeased'), '1' => $langs->trans('InActivity')), $object->status, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100', 1); print ''; - $colspan = ($conf->browser->layout == 'phone' ? 2 : 4); - print ' '; + //$colspan = ($conf->browser->layout == 'phone' ? 2 : 4); + $colspan = 4; + print ''; // Address print ''; @@ -2550,7 +2557,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // Social network if (isModEnabled('socialnetworks')) { - $colspan = ($conf->browser->layout == 'phone' ? 2 : 4); + //$colspan = ($conf->browser->layout == 'phone' ? 2 : 4); + $colspan = 4; $object->showSocialNetwork($socialnetworks, $colspan); @@ -2833,24 +2841,24 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio if (isModEnabled('accounting')) { /** @var FormAccounting $formaccounting */ // Accountancy_code_sell - print ''; + print ''; print ''; // Accountancy_code_buy - print ''; + print ''; print ''; } else { // For external software // Accountancy_code_sell - print ''; + print ''; print ''; // Accountancy_code_buy - print ''; + print ''; print ''; } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 8ced8b891c4..0508e7ac723 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -5713,6 +5713,16 @@ class Societe extends CommonObject // End call triggers } + if (!$error) { + // We finally remove the old thirdparty + if ($soc_origin->delete($soc_origin->id, $user) < 1) { + $this->error = $soc_origin->error; + $this->errors = $soc_origin->errors; + $error++; + } + } + + if (!$error) { // Move files from the dir of the third party to delete into the dir of the third party to keep if (!empty($conf->societe->multidir_output[$this->entity])) { @@ -5731,16 +5741,6 @@ class Societe extends CommonObject } } - - if (!$error) { - // We finally remove the old thirdparty - if ($soc_origin->delete($soc_origin->id, $user) < 1) { - $this->error = $soc_origin->error; - $this->errors = $soc_origin->errors; - $error++; - } - } - if (!$error) { $this->db->commit(); return 0; diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index e97ec89d8fa..47207ec2fda 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; //require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + /** * Class for SocieteAccount */ @@ -257,6 +258,15 @@ class SocieteAccount extends CommonObject */ public function create(User $user, $notrigger = 0) { + global $langs; + + if ($this->site == 'dolibarr_website') { + if ((int) $this->fk_website <= 0) { + $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Website")); + return -1; + } + } + return $this->createCommon($user, $notrigger); } diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 4ed8e18f7d6..1fa3b0678f7 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -35,6 +35,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; +require_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -684,15 +685,14 @@ while ($i < $imaxinloop) { print ' title="'.dol_escape_htmltag($object->$key).'"'; } print '>'; - /*if ($key == 'status') { - print $objectwebsiteaccount->getLibStatut(5); - } elseif ($key == 'rowid') { - print $objectwebsiteaccount->showOutputField($val, $key, $object->id, ''); - } else { - print $objectwebsiteaccount->showOutputField($val, $key, $object->$key, ''); - }*/ if ($key == 'login') { print $objectwebsiteaccount->getNomUrl(1, '', 0, '', 1); + } elseif ($key == 'fk_website') { + if ($obj->$key > 0) { + $tmpwebsite = new Website($db); + $tmpwebsite->fetch($obj->$key); + print $tmpwebsite->getNomUrl(1); + } } else { print $objectwebsiteaccount->showOutputField($val, $key, $obj->$key, ''); } diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index a017742d722..eb08aac811d 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -379,18 +379,30 @@ print ''.$langs->trans("Example").': '.$mysoc->name.''; print ''; -print ''; - print ''; -if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { // What is this for ? + +// Param to record automatically payouts (received from IPN payout.payed and payout.created) +print ''; + +if (getDolGlobalInt('STRIPE_AUTO_RECORD_PAYOUT')) { + print ''; + print '
'; @@ -2437,12 +2443,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Status - print '
'.$form->editfieldkey('Status', 'status', '', $object, 0).''; + print '
'.$form->editfieldkey('Status', 'status', '', $object, 0).'
 
'.$form->editfieldkey('Address', 'address', '', $object, 0).'
'.$langs->trans("ProductAccountancySellCode").'
'.$langs->trans("ProductAccountancySellCode").''; print $formaccounting->select_account($object->accountancy_code_sell, 'accountancy_code_sell', 1, array(), 1, 1); print '
'.$langs->trans("ProductAccountancyBuyCode").'
'.$langs->trans("ProductAccountancyBuyCode").''; print $formaccounting->select_account($object->accountancy_code_buy, 'accountancy_code_buy', 1, array(), 1, 1); print '
'.$langs->trans("ProductAccountancySellCode").'
'.$langs->trans("ProductAccountancySellCode").''; print '
'.$langs->trans("ProductAccountancyBuyCode").'
'.$langs->trans("ProductAccountancyBuyCode").''; print '
'; -print $langs->trans("StripeUserAccountForActions").''; -print img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers(getDolGlobalString('STRIPE_USER_ACCOUNT_FOR_ACTIONS'), 'STRIPE_USER_ACCOUNT_FOR_ACTIONS', 0); -print '
'; print $langs->trans("BankAccount").''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); $form->select_comptes(getDolGlobalString('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'), 'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); print '
'; +print $langs->trans("StripeAutoRecordPayout").''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STRIPE_AUTO_RECORD_PAYOUT', array(), null, 0, 0, 1); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STRIPE_AUTO_RECORD_PAYOUT", $arrval, getDolGlobalInt('STRIPE_AUTO_RECORD_PAYOUT')); +} +print '
'; + print $langs->trans("StripeUserAccountForActions").''; + print img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers(getDolGlobalString('STRIPE_USER_ACCOUNT_FOR_ACTIONS'), 'STRIPE_USER_ACCOUNT_FOR_ACTIONS', 0); + print '
'; print $langs->trans("BankAccountForBankTransfer").''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 44f1ff7ddd8..24f981291a5 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -329,10 +329,10 @@ if (getDolGlobalString('THEME_INFOBOX_COLOR_ON_BACKGROUND')) { } if (!isset($conf->global->THEME_SATURATE_RATIO)) { - $conf->global->THEME_SATURATE_RATIO = 0.7; + $conf->global->THEME_SATURATE_RATIO = 0.8; } if (GETPOSTISSET('THEME_SATURATE_RATIO')) { - $conf->global->THEME_SATURATE_RATIO = GETPOSTINT('THEME_SATURATE_RATIO'); + $conf->global->THEME_SATURATE_RATIO = GETPOSTFLOAT('THEME_SATURATE_RATIO'); } ?> @@ -341,8 +341,8 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) { color: #fff !important; opacity: 0.95; - global->THEME_SATURATE_RATIO)) { ?> - filter: saturate(global->THEME_SATURATE_RATIO; ?>); + + filter: saturate(); } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 9ce2b990fcd..4fad79772c3 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -411,7 +411,7 @@ print 'fontsizesmaller='.$fontsizesmaller."\n"; print 'topMenuFontSize='.$topMenuFontSize."\n"; print 'toolTipBgColor='.$toolTipBgColor."\n"; print 'toolTipFontColor='.$toolTipFontColor."\n"; -print 'conf->global->THEME_SATURATE_RATIO='.getDolGlobalString('THEME_SATURATE_RATIO')." (must be between 0 and 1)\n"; +print 'getDolGlobalString("THEME_SATURATE_RATIO")='.getDolGlobalString('THEME_SATURATE_RATIO')." (must be between 0 and 1)\n"; print '*/'."\n"; diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index f2afc753cf4..a0588f5656b 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -34,10 +34,10 @@ if (getDolGlobalString('THEME_INFOBOX_COLOR_ON_BACKGROUND')) { } if (!isset($conf->global->THEME_SATURATE_RATIO)) { - $conf->global->THEME_SATURATE_RATIO = 0.7; + $conf->global->THEME_SATURATE_RATIO = 0.8; } if (GETPOSTISSET('THEME_SATURATE_RATIO')) { - $conf->global->THEME_SATURATE_RATIO = GETPOSTINT('THEME_SATURATE_RATIO'); + $conf->global->THEME_SATURATE_RATIO = GETPOSTFLOAT('THEME_SATURATE_RATIO'); } ?> @@ -241,8 +241,8 @@ a.info-box-text-a i.fa.fa-exclamation-triangle { height: 94px; /* must be same height as min-height of .info-box */ width: 86px; background: var(--colorbacktitle1) !important; - global->THEME_SATURATE_RATIO)) { ?> - filter: saturate(global->THEME_SATURATE_RATIO; ?>); + + filter: saturate(); } @@ -459,10 +459,10 @@ if (getDolGlobalString('THEME_INFOBOX_COLOR_ON_BACKGROUND')) { } if (!isset($conf->global->THEME_SATURATE_RATIO)) { - $conf->global->THEME_SATURATE_RATIO = 0.7; + $conf->global->THEME_SATURATE_RATIO = 0.8; } if (GETPOSTISSET('THEME_SATURATE_RATIO')) { - $conf->global->THEME_SATURATE_RATIO = GETPOSTINT('THEME_SATURATE_RATIO'); + $conf->global->THEME_SATURATE_RATIO = GETPOSTFLOAT('THEME_SATURATE_RATIO'); } ?> .bg-infobox-project i.fa{ diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 43dc5599601..65ef58f22dd 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -901,25 +901,31 @@ class Website extends CommonObject $result = ''; - $label = ''.$langs->trans("WebSite").''; + $label = ''.img_picto('', 'website', 'class="pictofixedwidth"').$langs->trans("WebSite").''; $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref.'
'; $label .= ''.$langs->trans('MainLanguage').': '.$this->lang; - $linkstart = 'picto ? $this->picto : 'generic'), ($notooltip ? '' : 'class="classfortooltip"')).$linkend); - if ($withpicto != 2) { - $result .= ' '; - } + */ + if (!empty($this->virtualhost)) { + $linkstart = ''; + $linkend = ''; + } else { + $linkstart = $linkend = ''; } - $result .= $linkstart.$this->ref.$linkend; + + $result .= $linkstart; + if ($withpicto) { + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), 'class="pictofixedwidth'.($notooltip ? '' : ' classfortooltip').'"'); + } + $result .= $this->ref; + $result .= $linkend; + return $result; }