Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur (aka Eldy) 2025-01-24 15:25:51 +01:00
commit fbe4ccd0e2
84 changed files with 646 additions and 457 deletions

View File

@ -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)

View File

@ -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);

View File

@ -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 '<tr>';
// Date start subscription
print '<tr>';
$currentyear = dol_print_date($now, "%Y");
$currentmonth = dol_print_date($now, "%m");
print '<td class="fieldrequired">'.$langs->trans("DateSubscription").'</td><td>';
@ -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 '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="subscription" size="6" value="'.(GETPOSTISSET('subscription') ? GETPOST('subscription') : price($adht->amount, 0, '', 0)).'"> '.$langs->trans("Currency".$conf->currency) .'</td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td>';
print '<td><input autofocus class="width50" type="text" name="subscription" value="'.(GETPOSTISSET('subscription') ? GETPOST('subscription') : (is_null($adht->amount) ? '' : price($adht->amount, 0, '', 0))).'"> '.$langs->trans("Currency".$conf->currency) .'</td></tr>';
// Label
print '<tr><td>'.$langs->trans("Label").'</td>';

View File

@ -80,7 +80,7 @@ print '<br>';
$object->info($rowid);
print '<table width="100%"><tr><td>';
print '<table class="centpercent"><tr><td>';
dol_print_object_info($object);
print '</td></tr></table>';

View File

@ -127,7 +127,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
print '<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans("CompanyInfo").'</th><th></th></tr>'."\n";
// Name of Accountant Company
print '<tr class="oddeven"><td><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';

View File

@ -444,8 +444,8 @@ print load_fiche_titre($langs->trans("BankColorizeMovement"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'."\n";
print '<tr class="liste_titre">'."\n";
print '<td colspan="4">'.$langs->trans("Name").'</td>';
print '<td align="center" width="75">'.$langs->trans("Value").'</td>'."\n";
print '<td colspan="4">'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="75"></td>'."\n";
print "</tr>\n";
print '<tr class="oddeven"><td colspan="4">';

View File

@ -450,7 +450,7 @@ print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td width="60" class="center">'.$langs->trans("Value").'</td>';
print '<td width="60" class="center"></td>';
print '<td>&nbsp;</td>';
print '</tr>';

View File

@ -456,7 +456,7 @@ print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td class="center" width="60">'.$langs->trans("Value").'</td>';
print '<td class="center" width="60"></td>';
print "<td>&nbsp;</td>\n";
print "</tr>\n";

View File

@ -92,8 +92,8 @@ print '<input type="hidden" name="action" value="setvalue">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td class="minwidth200">'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td class="minwidth200">'.$langs->trans("Parameter").'</td>';
print '<td></td>';
print "</tr>\n";

View File

@ -899,7 +899,7 @@ if ($mysoc->country_code == 'GR') {
print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("AccountParameter").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td></td>';
print '<td></td>';
print "</tr>\n";

View File

@ -497,7 +497,7 @@ print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td class="right">'.$langs->trans("Value").'</td>';
print '<td class="right"></td>';
print "</tr>\n";
$substitutionarray = pdf_getSubstitutionArray($langs, array('objectamount'), null, 2);

View File

@ -102,7 +102,7 @@ if ($action == 'edit') {
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent nomarginbottom">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td></td></tr>';
foreach ($arrayofparameters as $key => $val) {
if (isset($val['enabled']) && empty($val['enabled'])) {
@ -138,7 +138,7 @@ if ($action == 'edit') {
print '<br>';
} else {
print '<table class="noborder centpercent nomarginbottom">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td></td></tr>';
foreach ($arrayofparameters as $key => $val) {
if (isset($val['enabled']) && empty($val['enabled'])) {

View File

@ -97,7 +97,7 @@ print '<input type="hidden" name="action" value="set">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td>';
print '<td>'.$langs->trans("Parameter").'</td><td></td>';
print '<td class="right"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>';
print "</tr>\n";

View File

@ -249,11 +249,11 @@ if ($action == 'edit') {
// Show if meteo is enabled
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Option").'</td><td class="right">'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td>'.$langs->trans("Option").'</td><td class="right"></td></tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="right">';
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 '</td></tr>';
print '</table>';
@ -263,7 +263,7 @@ if ($action == 'edit') {
*/
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("DelaysOfToleranceBeforeWarning").'</td><td class="right">'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("DelaysOfToleranceBeforeWarning").'</td><td class="right"></td></tr>';
foreach ($modules as $module => $delays) {
if (isModEnabled($module)) {
@ -283,7 +283,7 @@ if ($action == 'edit') {
// Show if meteo is enabled
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Option").'</td><td class="right">'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td>'.$langs->trans("Option").'</td><td class="right"></td></tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">';

View File

@ -490,7 +490,7 @@ if (getDolGlobalString('MAIN_SUBMODULE_DELIVERY')) {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print '<td align="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";

View File

@ -96,7 +96,7 @@ print dol_get_fiche_head($head, 'ecm', '', -1, '');
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Description").'</td>';
print '<td class="center" width="100px">'.$langs->trans("Value").'</td>'."\n";
print '<td class="center" width="100px"></td>'."\n";
print '</tr>';
// Mail required for members

View File

@ -186,7 +186,7 @@ if ($action == 'edit') {
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td></td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled'] == 1) {
@ -269,7 +269,7 @@ if ($action == 'edit') {
} else {
if (!empty($arrayofparameters)) {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td></td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled'] == 1) {

View File

@ -538,7 +538,7 @@ print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print '<td align="center" width="60"></td>';
print "<td>&nbsp;</td>\n";
print "</tr>\n";

View File

@ -110,7 +110,7 @@ print '<input type="hidden" name="action" value="set">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td>';
print '<td>'.$langs->trans("Parameter").'</td><td></td>';
print '<td class="right"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>';
print "</tr>\n";

View File

@ -461,27 +461,9 @@ print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print '<td align="center" width="60"></td>';
print "</tr>\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 '<tr class="oddeven">';
print "<td>".$langs->trans("XIsAUsualNonWorkingDay", $langs->transnoentitiesnoconv("Monday"))."</td>";

View File

@ -510,7 +510,7 @@ if ($action == 'edit') {
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td></td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled'] == 1) {
@ -595,7 +595,7 @@ if ($action == 'edit') {
} else {
if (!empty($arrayofparameters)) {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td></td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled'] == 1) {

View File

@ -792,7 +792,7 @@ print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameters").'</td>';
print '<td class="center" width="60">'.$langs->trans("Value").'</td>';
print '<td class="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
@ -879,7 +879,7 @@ print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'."\n";
print '<tr class="liste_titre">'."\n";
print '<td>'.$langs->trans("Name").'</td>'."\n";
print '<td>'.$langs->trans("Value").'</td>'."\n";
print '<td></td>'."\n";
print "</tr>\n";
print '<tr class="oddeven">'."\n";
print '<td width="140">'.$langs->trans("PathDirectory").'</td>'."\n";

View File

@ -217,7 +217,7 @@ if ($action == 'edit') {
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td></td></tr>';
// @phan-suppress-next-line PhanEmptyForeach
foreach ($arrayofparameters as $constname => $val) {
@ -285,7 +285,7 @@ if ($action == 'edit') {
} else {
if (!empty($arrayofparameters)) {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td></td></tr>';
// @phan-suppress-next-line PhanEmptyForeach
foreach ($arrayofparameters as $constname => $val) {

View File

@ -198,7 +198,7 @@ print $hookmanager->resPrint;
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td></td>';
print '<td>'.$langs->trans("Example").'</td>';
print "</tr>\n";

View File

@ -173,7 +173,7 @@ if ($action == 'edit') {
clearstatcache();
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameters").'</td><td></td></tr>';
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"), $langs->trans("ParameterActiveForNextInputOnly"));
@ -204,7 +204,7 @@ if ($action == 'edit') {
} else {
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="right">'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="right"></td></tr>';
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"), $langs->trans("ParameterActiveForNextInputOnly"));

View File

@ -144,7 +144,7 @@ print '<input type="hidden" name="action" value="setvalue">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td></td>';
print '<td class="hideonsmartphone">'.$langs->trans("Example").'</td>';
print "</tr>\n";

View File

@ -118,7 +118,7 @@ print "<br><br>\n";
/*
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td></td></tr>';
print '<br>';

View File

@ -450,7 +450,7 @@ print load_fiche_titre($langs->trans("OtherOptions"), '', '');
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td class="center" width="60">'.$langs->trans("Value").'</td>';
print '<td class="center" width="60"></td>';
print "<td>&nbsp;</td>\n";
print "</tr>\n";

View File

@ -202,7 +202,7 @@ print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td></td>';
print "</tr>\n";

View File

@ -107,37 +107,37 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit') {
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("Monday"), $langs->trans("OpeningHoursFormatDesc"));
print '</td><td>';
print '<input name="monday" id="monday" class="minwidth100" value="'.(getDolGlobalString('MAIN_INFO_OPENINGHOURS_MONDAY') ? $conf->global->MAIN_INFO_OPENINGHOURS_MONDAY : GETPOST("monday", 'alpha')).'"'.(!getDolGlobalString('MAIN_INFO_OPENINGHOURS_MONDAY') ? ' autofocus="autofocus"' : '').'></td></tr>'."\n";
print '<input name="monday" id="monday" class="minwidth100" value="'.getDolGlobalString('MAIN_INFO_OPENINGHOURS_MONDAY', GETPOST("monday", 'alpha')).'"'.(getDolGlobalString('MAIN_INFO_OPENINGHOURS_MONDAY') ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("Tuesday"), $langs->trans("OpeningHoursFormatDesc"));
print '</td><td>';
print '<input name="tuesday" id="tuesday" class="minwidth100" value="'.(getDolGlobalString('MAIN_INFO_OPENINGHOURS_TUESDAY') ? $conf->global->MAIN_INFO_OPENINGHOURS_TUESDAY : GETPOST("tuesday", 'alpha')).'"></td></tr>'."\n";
print '<input name="tuesday" id="tuesday" class="minwidth100" value="'.getDolGlobalString('MAIN_INFO_OPENINGHOURS_TUESDAY', GETPOST("tuesday", 'alpha')).'"></td></tr>'."\n";
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("Wednesday"), $langs->trans("OpeningHoursFormatDesc"));
print '</td><td>';
print '<input name="wednesday" id="wednesday" class="minwidth100" value="'.(getDolGlobalString('MAIN_INFO_OPENINGHOURS_WEDNESDAY') ? $conf->global->MAIN_INFO_OPENINGHOURS_WEDNESDAY : GETPOST("wednesday", 'alpha')).'"></td></tr>'."\n";
print '<input name="wednesday" id="wednesday" class="minwidth100" value="'.getDolGlobalString('MAIN_INFO_OPENINGHOURS_WEDNESDAY', GETPOST("wednesday", 'alpha')).'"></td></tr>'."\n";
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("Thursday"), $langs->trans("OpeningHoursFormatDesc"));
print '</td><td>';
print '<input name="thursday" id="thursday" class="minwidth100" value="'.(getDolGlobalString('MAIN_INFO_OPENINGHOURS_THURSDAY') ? $conf->global->MAIN_INFO_OPENINGHOURS_THURSDAY : GETPOST("thursday", 'alpha')).'"></td></tr>'."\n";
print '<input name="thursday" id="thursday" class="minwidth100" value="'.getDolGlobalString('MAIN_INFO_OPENINGHOURS_THURSDAY', GETPOST("thursday", 'alpha')).'"></td></tr>'."\n";
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("Friday"), $langs->trans("OpeningHoursFormatDesc"));
print '</td><td>';
print '<input name="friday" id="friday" class="minwidth100" value="'.(getDolGlobalString('MAIN_INFO_OPENINGHOURS_FRIDAY') ? $conf->global->MAIN_INFO_OPENINGHOURS_FRIDAY : GETPOST("friday", 'alpha')).'"></td></tr>'."\n";
print '<input name="friday" id="friday" class="minwidth100" value="'.getDolGlobalString('MAIN_INFO_OPENINGHOURS_FRIDAY', GETPOST("friday", 'alpha')).'"></td></tr>'."\n";
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("Saturday"), $langs->trans("OpeningHoursFormatDesc"));
print '</td><td>';
print '<input name="saturday" id="saturday" class="minwidth100" value="'.(getDolGlobalString('MAIN_INFO_OPENINGHOURS_SATURDAY') ? $conf->global->MAIN_INFO_OPENINGHOURS_SATURDAY : GETPOST("saturday", 'alpha')).'"></td></tr>'."\n";
print '<input name="saturday" id="saturday" class="minwidth100" value="'.getDolGlobalString('MAIN_INFO_OPENINGHOURS_SATURDAY', GETPOST("saturday", 'alpha')).'"></td></tr>'."\n";
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("Sunday"), $langs->trans("OpeningHoursFormatDesc"));
print '</td><td>';
print '<input name="sunday" id="sunday" class="minwidth100" value="'.(getDolGlobalString('MAIN_INFO_OPENINGHOURS_SUNDAY') ? $conf->global->MAIN_INFO_OPENINGHOURS_SUNDAY : GETPOST("sunday", 'alpha')).'"></td></tr>'."\n";
print '<input name="sunday" id="sunday" class="minwidth100" value="'.getDolGlobalString('MAIN_INFO_OPENINGHOURS_SUNDAY', GETPOST("sunday", 'alpha')).'"></td></tr>'."\n";
print '</table>';

View File

@ -649,7 +649,7 @@ print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td class="center" width="60">'.$langs->trans("Value").'</td>';
print '<td class="center" width="60"></td>';
print "<td>&nbsp;</td>\n";
print "</tr>\n";

View File

@ -265,7 +265,7 @@ print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print '<td align="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";

View File

@ -162,7 +162,7 @@ print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td></td>';
print "</tr>";
// Bank account (from Banks module)
@ -445,7 +445,7 @@ if (isModEnabled('notification'))
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("User").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td></td>';
print '<td class="right">'.$langs->trans("Action").'</td>';
print "</tr>\n";

View File

@ -306,7 +306,7 @@ print load_fiche_titre($langs->trans("DictionaryPaperFormat"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
$selected = getDolGlobalString('MAIN_PDF_FORMAT');
if (empty($selected)) {
@ -515,7 +515,7 @@ print load_fiche_titre($langs->trans("Other"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td></td></tr>';
// Use 2 languages into PDF

View File

@ -214,7 +214,7 @@ if (isModEnabled('propal')) {
print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px"></td></tr>';
/* This feature seems not yet used into Dolibarr. So option is kept hidden and enabled by default
print '<tr class="oddeven"><td>';
@ -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 '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), $langs->trans("PdfAddTermOfSaleHelp"));
print '</td><td>';
@ -271,19 +272,8 @@ if (isModEnabled('order')) {
print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_ORDER);
}
print '</td></tr>';
print '</table>';
print '</div>';
}
if (isModEnabled('order')) {
$langs->load("orders");
print load_fiche_titre($langs->trans('CustomersOrders'), '', 'order');
print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print '<tr class="oddeven"><td>';
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESS"), $langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESSMore"));
print '</td><td>';
if ($conf->use_javascript_ajax) {
@ -305,7 +295,7 @@ if (isModEnabled('supplier_proposal')) {
print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px"></td></tr>';
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"), '');
@ -340,7 +330,7 @@ if (isModEnabled('supplier_order')) {
print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px"></td></tr>';
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"), '');
@ -373,7 +363,7 @@ if (isModEnabled('invoice')) {
print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_INVOICE"), $langs->trans("PdfAddTermOfSaleHelp"));
@ -489,7 +479,7 @@ if (isModEnabled('shipping')) {
print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
print '<tr class="oddeven"><td>';
print $langs->trans("BARCODE_ON_SHIPPING_PDF");
@ -511,7 +501,7 @@ if (isModEnabled('reception')) {
print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
print '<tr class="oddeven"><td>';
print $langs->trans("RECEPTION_PDF_HIDE_ORDERED");
@ -554,7 +544,7 @@ if (isModEnabled('stocktransfer')) {
print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
print '<tr class="oddeven"><td>';
print $langs->trans("BARCODE_ON_STOCKTRANSFER_PDF");
@ -574,7 +564,7 @@ if (isModEnabled('stocktransfer')) {
print load_fiche_titre($langs->trans("Files"), '', 'file');
print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
// Terms of sale
$tooltiptermsofsale = $langs->trans('AvailableFormats').' : pdf';

View File

@ -164,7 +164,7 @@ print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td></td>';
print "</tr>";
@ -460,7 +460,7 @@ if (isModEnabled('notification') )
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("User").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td></td>';
print '<td class="right">'.$langs->trans("Action").'</td>';
print "</tr>\n";

View File

@ -88,7 +88,7 @@ print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
print '<td class="right">'.$langs->trans("Value").'</td>'."\n";
print '<td class="right"></td>'."\n";
print '<td></td>';

View File

@ -181,7 +181,7 @@ if ($action == 'edit') {
clearstatcache();
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td></td></tr>';
// Disable
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_SMS").'</td><td>';
@ -217,7 +217,7 @@ if ($action == 'edit') {
print '<br>';
} else {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td></td></tr>';
// Disable
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_SMS").'</td><td>'.yn(getDolGlobalString('MAIN_DISABLE_ALL_SMS')).'</td></tr>';

View File

@ -697,7 +697,7 @@ print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print "<td>".$langs->trans("Parameter")."</td>\n";
print '<td class="right">'.$langs->trans("Value").'</td>'."\n";
print '<td class="right"></td>'."\n";
print '</tr>'."\n";
print '<tr class="oddeven">';

View File

@ -192,7 +192,7 @@ print '<span class="opacitymedium">'.$langs->trans("StockTransferSetupPage").'</
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td></td></tr>';
foreach ($arrayofparameters as $key => $val)
{
@ -213,7 +213,7 @@ print '<span class="opacitymedium">'.$langs->trans("StockTransferSetupPage").'</
if (!empty($arrayofparameters))
{
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td></td></tr>';
foreach ($arrayofparameters as $key => $val)
{

View File

@ -472,7 +472,7 @@ print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print '<td align="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";

View File

@ -477,7 +477,7 @@ print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print '<td align="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";

View File

@ -454,7 +454,7 @@ print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print '<td align="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";

View File

@ -217,7 +217,7 @@ print '<div class="div-table-responsive-no-min">'; // You can use div-table-resp
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Type").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td></td>';
print '<td class="center width150"><input type="submit" class="button small" '.$optionmc.' value="'.$langs->trans("Modify").'"></td>';
print "</tr>\n";
@ -309,7 +309,7 @@ print '<input type="hidden" name="action" value="setlevel">';
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td>';
print '<td>'.$langs->trans("Parameter").'</td><td></td>';
print '<td class="center width150"><input type="submit" class="button small" '.$optionmc.' value="'.$langs->trans("Modify").'"></td>';
print "</tr>\n";

View File

@ -180,7 +180,7 @@ if (empty($mysoc->tva_assuj)) {
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameters").'</td><td></td></tr>';
print '<tr class="oddeven"><td><label for="intra_vat">'.$langs->trans("VATIntra").'</label></td><td>';
print '<input name="tva" id="intra_vat" class="minwidth200" value="'.getDolGlobalString('MAIN_INFO_TVAINTRA').'">';

View File

@ -182,7 +182,7 @@ if ($action == 'edit') {
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td></td></tr>';
// @phan-suppress-next-line PhanEmptyForeach
foreach ($arrayofparameters as $constname => $val) {
@ -273,7 +273,7 @@ if ($action == 'edit') {
} else {
if (!empty($arrayofparameters)) {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td></td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled'] == 1) {

View File

@ -128,7 +128,7 @@ print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="20">&nbsp;</td>';
print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
print '<td align="center" width="100"></td>'."\n";
print '</tr>';

View File

@ -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 '<span class="opacitymedium">'.$langs->trans("WorkstationSetupPage").'</span><br><br>';
if ($action == 'edit') {
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
// @phan-suppress-next-line PhanEmptyForeach
foreach ($arrayofparameters as $key => $val) {
print '<tr class="oddeven"><td>';
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($key).'"></td></tr>';
}
print '</table>';
print '<br><div class="center">';
print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
print '</div>';
print '</form>';
print '<br>';
} else {
if (!empty($arrayofparameters)) {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $key => $val) {
$setupnotempty++;
print '<tr class="oddeven"><td>';
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
print '</td><td>'.getDolGlobalString($key).'</td></tr>';
}
print '</table>';
print '<div class="tabsAction">';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
print '</div>';
}/* else {
print '<br>'.$langs->trans("NothingToSetup");
}*/
}
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($myTmpObjectArray['includerefgeneration']) {

View File

@ -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 : ''));

View File

@ -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";

View File

@ -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 '<table class="border centpercent">';
@ -831,17 +831,21 @@ if ($action == 'create') { // aaa
}
print '</table>';
print '<br><br>';
print '<br>';
print '<table class="border centpercent">';
print '<tr class="fieldsforemail"><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailFrom").'</td><td><input class="flat minwidth200" name="from" value="'.(GETPOSTISSET('from') ? GETPOST('from') : getDolGlobalString('MAILING_EMAIL_FROM')).'"></td></tr>';
print '<tr class="fieldsforemail"><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailFrom").'</td>';
print '<td>'.img_picto('', 'email', 'class="pictofixedwidth"').'<input class="flat minwidth200" name="from" value="'.(GETPOSTISSET('from') ? GETPOST('from') : getDolGlobalString('MAILING_EMAIL_FROM')).'"></td></tr>';
print '<tr class="fieldsforsms hidden"><td class="fieldrequired titlefieldcreate">'.$langs->trans("PhoneFrom").'</td><td><input class="flat minwidth200" name="fromphone" value="'.(GETPOSTISSET('fromphone') ? GETPOST('fromphone') : getDolGlobalString('MAILING_SMS_FROM')).'" placeholder="+123..."></td></tr>';
print '<tr class="fieldsforsms hidden"><td class="fieldrequired titlefieldcreate">'.$langs->trans("PhoneFrom").'</td>';
print '<td>'.img_picto('', 'email', 'class="pictofixedwidth"').'<input class="flat minwidth200" name="fromphone" value="'.(GETPOSTISSET('fromphone') ? GETPOST('fromphone') : getDolGlobalString('MAILING_SMS_FROM')).'" placeholder="+123..."></td></tr>';
print '<tr class="fieldsforemail"><td>'.$langs->trans("MailErrorsTo").'</td><td><input class="flat minwidth200" name="errorsto" value="'.getDolGlobalString('MAILING_EMAIL_ERRORSTO', getDolGlobalString('MAIN_MAIL_ERRORS_TO')).'"></td></tr>';
print '<tr class="fieldsforemail"><td>'.$langs->trans("MailErrorsTo").'</td>';
print '<td>'.img_picto('', 'email', 'class="pictofixedwidth"').'<input class="flat minwidth200" name="errorsto" value="'.getDolGlobalString('MAILING_EMAIL_ERRORSTO', getDolGlobalString('MAIN_MAIL_ERRORS_TO')).'"></td></tr>';
print '<tr class="fieldsforemail"><td>'.$langs->trans("MailReply").'</td><td><input class="flat minwidth200" name="replyto" value="'.getDolGlobalString('MAILING_EMAIL_REPLYTO', getDolGlobalString('MAIN_MAIL_REPLY_TO')).'"></td></tr>';
print '<tr class="fieldsforemail"><td>'.$langs->trans("MailReply").'</td>';
print '<td>'.img_picto('', 'email', 'class="pictofixedwidth"').'<input class="flat minwidth200" name="replyto" value="'.getDolGlobalString('MAILING_EMAIL_REPLYTO', getDolGlobalString('MAIN_MAIL_REPLY_TO')).'"></td></tr>';
// Other attributes
$parameters = array();
@ -852,7 +856,8 @@ if ($action == 'create') { // aaa
}
print '</table>';
print '<br><br>';
print '<br>';
print '<table class="border centpercent">';
print '<tr class="fieldsforemail"><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTopic").'</td><td><input id="sujet" class="flat minwidth200 quatrevingtpercent" name="sujet" value="'.dol_escape_htmltag(GETPOST('sujet', 'alphanohtml')).'"></td></tr>';
@ -889,7 +894,7 @@ if ($action == 'create') { // aaa
print '<div style="padding-top: 10px">';
// 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 '</div>';
@ -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 ' <span class="opacitymedium">('.getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING', getDolGlobalString('MAIN_MAIL_SMTP_SERVER')).')</span>';
}
} 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');
}

View File

@ -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 ' <span class="opacitymedium">('.getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING', getDolGlobalString('MAIN_MAIL_SMTP_SERVER')).')</span>';
}
} elseif (getDolGlobalString('MAIN_MAIL_SENDMODE') != 'mail' && getDolGlobalString('MAIN_MAIL_SMTP_SERVER')) {
@ -678,7 +678,7 @@ if ($object->fetch($id) >= 0) {
print '<br>';
}
print '<br>';
print '<br><br>';
}
// List of selected targets

View File

@ -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;

View File

@ -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;

View File

@ -1,12 +1,12 @@
<?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Pierre-Henry Favre <support@atm-consulting.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2022-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Pierre-Henry Favre <support@atm-consulting.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2022-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* 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);

View File

@ -73,16 +73,17 @@ if (GETPOSTISSET('content')) {
foreach ($selectedPosts as $postId) {
$post = getNewsDetailsById($postId);
$newsList .= '<div style="display: flex; align-items: flex-start; justify-content: flex-start; width: 100%; max-width: 800px; margin-top: 20px;margin-bottom: 50px; padding: 20px;">
<div style="flex-grow: 1; margin-right: 30px; max-width: 600px; margin-left: 100px;">
<h2 style="margin: 0; font-size: 1.5em;">' . htmlentities($post['title']) . '</h2>
<p style="margin: 10px 0; color: #555;">' . htmlentities($post['description']) . '</p>
<span style="display: block; margin-bottom: 5px; color: #888;">Created By: <strong>' . htmlentities($post['user_fullname']) . '</strong></span>
<h2 style="margin: 0; font-size: 1.5em;">' . htmlentities(empty($post['title']) ? '' : $post['title']) . '</h2>
<p style="margin: 10px 0; color: #555;">' . htmlentities(empty($post['description']) ? '' : $post['description']) . '</p>
<span style="display: block; margin-bottom: 5px; color: #888;">Created By: <strong>' . htmlentities(empty($post['user_fullname']) ? '' : $post['user_fullname']) . '</strong></span>
<br>
<span style="display: block; color: #888;">' . dol_print_date($post['date_creation'], 'daytext', 'tzserver', $langs) . '</span>
<span style="display: block; color: #888;">' . dol_print_date((empty($post['date_creation']) ? dol_now() : $post['date_creation']), 'daytext', 'tzserver', $langs) . '</span>
</div>
<div style="flex-shrink: 0; margin-left: 100px; float: right;">
' . ($post['image'] ? '<img alt="Image" width="130px" height="130px" style="border-radius: 10px;" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=medias&file=' . htmlentities($post['image']) . '">' : '<img alt="Gray rectangle" width="130px" height="130px" style="border-radius: 10px;" src="__GRAY_RECTANGLE__">') . '
' . (!empty($post['image']) ? '<img alt="Image" width="130px" height="130px" style="border-radius: 10px;" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=medias&file=' . htmlentities($post['image']) . '">' : '<img alt="Gray rectangle" width="130px" height="130px" style="border-radius: 10px;" src="__GRAY_RECTANGLE__">') . '
</div>
</div>';
}

View File

@ -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

View File

@ -20,7 +20,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \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)) {

View File

@ -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);
}
}

View File

@ -1693,7 +1693,7 @@ class FormMail extends Form
// Use the multiselect array function to create the dropdown
$out .= '<div id="post-dropdown-container" class="email-layout-container hidden" style="display:none;">';
$out .= '<label for="blogpost-select">Select Posts: </label>';
$out .= self::multiselectarray('blogpost-select', $blogArray);
$out .= self::multiselectarray('blogpost-select', $blogArray, array(), 0, 0, 'minwidth200');
$out .= '</div>';
$out .= '<script type="text/javascript">
@ -1706,9 +1706,7 @@ class FormMail extends Form
var sendtocc = jQuery("#sendtocc").val();
var sendtoccc = jQuery("#sendtoccc").val();
console.log("We choose a layout for email template=" + template + ", subject="+subject);
console.log("We choose a layout for email template " + template);
console.log("We choose a layout for email template=" + template + ", subject="+subject);
$(".template-option").removeClass("selected");
$(this).addClass("selected");

View File

@ -1828,6 +1828,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr
$sql .= " a.percent as percent, 'action' as type,";
$sql .= " a.fk_element, a.elementtype,";
$sql .= " a.fk_contact,";
$sql .= " a.code,";
$sql .= " c.code as acode, c.libelle as alabel, c.picto as apicto,";
$sql .= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname";
if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur'))) {
@ -2025,6 +2026,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr
$sql .= $hookmanager->resPrint;
}
// Now add events of emailing module
if (is_array($actioncode)) {
foreach ($actioncode as $code) {
$sql2 = addMailingEventTypeSQL($code, $objcon, $filterobj);
@ -2106,6 +2108,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr
'firstname' => empty($obj->firstname) ? '' : $obj->firstname,
'fk_element' => (int) $obj->fk_element,
'elementtype' => $obj->elementtype,
'code' => $obj->code,
// Type of event
'acode' => $obj->acode,
'alabel' => $obj->alabel,
@ -2121,6 +2126,10 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr
'dateend' => $db->jdate($obj->dp2),
'note' => $obj->label,
'percent' => (int) $obj->percent,
'code' => $obj->code,
// Type of event
'acode' => $obj->acode,
'userid' => (int) $obj->user_id,
@ -2257,11 +2266,14 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
$caction = new CActionComm($db);
$arraylist = $caction->liste_array(1, 'code', '', (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? 1 : 0), '', 1);
$arraylist = $caction->liste_array(1, 'code', '', (getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? 0 : 1), '', 1);
foreach ($histo as $key => $value) {
$actionstatic->fetch($histo[$key]['id']); // TODO Do we need this, we already have a lot of data of line into $histo
if (empty($actionstatic->code)) {
$actionstatic->code = $histo[$key]['acode'];
}
$actionstatic->type_picto = $histo[$key]['apicto'] ?? '';
$actionstatic->type_code = $histo[$key]['acode'];
@ -2333,25 +2345,39 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr
}
$out .= '</td>';
// type_code // column "acode" in the sql = code in type of actioncomm, example: AC_OTH_AUTO, AC_EMAILING
// code // columne code in the sql (not yet added), can be AC_CONTACT_SENTBYMAIL, ...
// Type
$labeltype = $actionstatic->type_code;
if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') && empty($arraylist[$labeltype])) {
$labeltype = 'AC_OTH';
$labelOfTypeToShow = $actionstatic->type_code;
//$typelabel = $actionstatic->type_label;
$code = $actionstatic->code;
if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') && empty($arraylist[$labelOfTypeToShow])) {
$labelOfTypeToShow = 'AC_OTH';
}
if (!empty($actionstatic->code) && preg_match('/^TICKET_MSG/', $actionstatic->code)) {
$labeltype = $langs->trans("Message");
$labelOfTypeToShow = $langs->trans("Message");
} else {
if (!empty($arraylist[$labeltype])) {
$labeltype = $arraylist[$labeltype];
if (!empty($arraylist[$labelOfTypeToShow])) {
$labelOfTypeToShow = $arraylist[$labelOfTypeToShow];
} elseif ($actionstatic->type_code == 'AC_EMAILING') {
$langs->load("mails");
$labelOfTypeToShow = $langs->trans("Emailing");
}
if ($actionstatic->type_code == 'AC_OTH_AUTO' && ($actionstatic->type_code != $actionstatic->code) && $labeltype && !empty($arraylist[$actionstatic->code])) {
$labeltype .= ' - '.$arraylist[$actionstatic->code]; // Use code in priority on type_code
if ($actionstatic->type_code == 'AC_OTH_AUTO' && ($actionstatic->type_code != $actionstatic->code) && $labelOfTypeToShow && !empty($arraylist[$actionstatic->code])) {
$labelOfTypeToShow .= ' - '.$arraylist[$actionstatic->code]; // Show also detailed code
}
}
$out .= '<td class="tdoverflowmax125" title="'.$labeltype.'">';
$labelOfTypeToShowLong = $labelOfTypeToShow;
if ($actionstatic->type_code == 'AC_OTH_AUTO') {
$labelOfTypeToShowLong .= ' (auto)';
}
$out .= '<td class="tdoverflowmax125" title="'.$labelOfTypeToShowLong.'">';
$out .= $actionstatic->getTypePicto();
//if (empty($conf->dol_optimize_smallscreen)) {
$out .= $labeltype;
$out .= $labelOfTypeToShow;
//}
$out .= '</td>';
@ -2360,18 +2386,19 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr
if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'action') {
$transcode = $langs->trans("Action".$histo[$key]['acode']);
//$libelle = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : $histo[$key]['alabel']);
$libelle = $histo[$key]['note'];
$label = $histo[$key]['note'];
$actionstatic->id = $histo[$key]['id'];
$out .= ' title="'.dol_escape_htmltag($libelle).'">';
$out .= dol_trunc($libelle, 120);
$out .= ' title="'.dol_escape_htmltag($label).'">';
$out .= dol_trunc($label, 120);
}
if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'mailing') {
$transcode = $langs->trans("Action".$histo[$key]['acode']);
$libelle = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : 'Send mass mailing');
$label = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : 'Send mass mailing');
$label .= ' - '.$histo[$key]['note'];
$out .= '<a href="'.DOL_URL_ROOT.'/comm/mailing/card.php?id='.$histo[$key]['id'].'"';
$out .= ' title="'.dol_escape_htmltag($libelle).'">';
$out .= img_object($langs->trans("ShowEMailing"), "email").' ';
$out .= dol_trunc($libelle, 120);
$out .= ' title="'.dol_escape_htmltag($label).'">';
//$out .= img_object($langs->trans("EMailing").'<br>'.$histo[$key]['note'], "email").' ';
$out .= dol_trunc($label, 120);
$out .= '</a>';
}
$out .= '</td>';
@ -2625,7 +2652,7 @@ function addMailingEventTypeSQL($actioncode, $objcon, $filterobj)
if (isModEnabled('mailing') && !empty($objcon->email) && (empty($actioncode) || $actioncode == 'AC_OTH_AUTO' || $actioncode == 'AC_EMAILING')) {
$sql2 = "SELECT m.rowid as id, m.titre as label, mc.date_envoi as dp, mc.date_envoi as dp2, '100' as percent, 'mailing' as type";
$sql2 .= ", null as fk_element, '' as elementtype, null as contact_id";
$sql2 .= ", 'AC_EMAILING' as acode, '' as alabel, '' as apicto";
$sql2 .= ", 'AC_EMAILING' as code, 'AC_EMAILING' as acode, '' as alabel, '' as apicto";
$sql2 .= ", u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; // User that valid action
if (is_object($filterobj) && get_class($filterobj) == 'Societe') {
$sql2 .= ", '' as lastname, '' as firstname";

View File

@ -1889,7 +1889,7 @@ function dol_init_file_process($pathtoscan = '', $trackid = '')
/**
* Get and save an upload file (for example after submitting a new file a mail form). Database index of file is also updated if donotupdatesession is set.
* Get and save an upload file (for example after submitting a new file a mail form). Database index of file is also updated if updatesessionordb is set to 1.
* All information used are in db, conf, langs, user and _FILES.
* Note: This function can be used only into a HTML page context.
*
@ -1913,15 +1913,17 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $updatesessionor
$res = 0;
if (!empty($_FILES[$varfiles])) { // For view $_FILES[$varfiles]['error']
dol_syslog('dol_add_file_process upload_dir='.$upload_dir.' allowoverwrite='.$allowoverwrite.' donotupdatesession='.$updatesessionordb.' savingdocmask='.$savingdocmask, LOG_DEBUG);
dol_syslog('dol_add_file_process upload_dir='.$upload_dir.' allowoverwrite='.$allowoverwrite.' updatesessionordb='.$updatesessionordb.' savingdocmask='.$savingdocmask, LOG_DEBUG);
$maxfilesinform = getDolGlobalInt("MAIN_SECURITY_MAX_ATTACHMENT_ON_FORMS", 10);
if (is_array($_FILES[$varfiles]["name"]) && count($_FILES[$varfiles]["name"]) > $maxfilesinform) {
$langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now.
setEventMessages($langs->trans("ErrorTooMuchFileInForm", $maxfilesinform), null, "errors");
return -1;
}
$result = dol_mkdir($upload_dir);
// var_dump($result);exit;
//var_dump($result);exit;
if ($result >= 0) {
$TFile = $_FILES[$varfiles];
// Convert value of $TFile
@ -2031,6 +2033,12 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $updatesessionor
if ($TFile['type'][$i] == 'application/pdf' && strpos($_SERVER["REQUEST_URI"], 'product') !== false && getDolGlobalString('PRODUCT_ALLOW_EXTERNAL_DOWNLOAD')) {
$sharefile = 1;
}
// If we allow overwrite, we may need to also overwrite index, so we delete index first so insert can work
if ($allowoverwrite) {
deleteFilesIntoDatabaseIndex($upload_dir, basename($destfile).($resupload == 2 ? '.noexe' : ''), '');
}
$result = addFileIntoDatabaseIndex($upload_dir, basename($destfile).($resupload == 2 ? '.noexe' : ''), $TFile['name'][$i], 'uploaded', $sharefile, $object);
if ($result < 0) {
if ($allowoverwrite) {
@ -2165,6 +2173,8 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo
$result = 0;
$error = 0;
dol_syslog("addFileIntoDatabaseIndex dir=".$dir." file=".$file, LOG_DEBUG);
$rel_dir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $dir);
if (!preg_match('/[\\/]temp[\\/]|[\\/]thumbs|\.meta$/', $rel_dir)) { // If not a temporary directory. TODO Does this test work ?
@ -2314,7 +2324,7 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo
*/
function deleteFilesIntoDatabaseIndex($dir, $file, $mode = 'uploaded')
{
global $conf, $db, $user;
global $conf, $db;
$error = 0;
@ -2323,29 +2333,33 @@ function deleteFilesIntoDatabaseIndex($dir, $file, $mode = 'uploaded')
return -1;
}
dol_syslog("deleteFilesIntoDatabaseIndex dir=".$dir." file=".$file, LOG_DEBUG);
$db->begin();
$rel_dir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $dir);
$filename = basename($file);
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
$rel_dir = preg_replace('/^[\\/]/', '', $rel_dir);
if (!preg_match('/[\\/]temp[\\/]|[\\/]thumbs|\.meta$/', $rel_dir)) { // If not a temporary directory. TODO Does this test work ?
$filename = basename($file);
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
$rel_dir = preg_replace('/^[\\/]/', '', $rel_dir);
if (!$error) {
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'ecm_files';
$sql .= ' WHERE entity = '.$conf->entity;
$sql .= " AND filepath = '".$db->escape($rel_dir)."'";
if ($file) {
$sql .= " AND filename = '".$db->escape($file)."'";
}
if ($mode) {
$sql .= " AND gen_or_uploaded = '".$db->escape($mode)."'";
}
if (!$error) {
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'ecm_files';
$sql .= ' WHERE entity = '.((int) $conf->entity);
$sql .= " AND filepath = '".$db->escape($rel_dir)."'";
if ($file) {
$sql .= " AND filename = '".$db->escape($file)."'";
}
if ($mode) {
$sql .= " AND gen_or_uploaded = '".$db->escape($mode)."'";
}
$resql = $db->query($sql);
if (!$resql) {
$error++;
dol_syslog(__FUNCTION__.' '.$db->lasterror(), LOG_ERR);
$resql = $db->query($sql);
if (!$resql) {
$error++;
dol_syslog(__FUNCTION__.' '.$db->lasterror(), LOG_ERR);
}
}
}

View File

@ -1875,6 +1875,33 @@ function dol_string_nounprintableascii($str, $removetabcrlf = 1)
}
}
/**
* Returns text slugified (no special char, separator is "-".
*
* @param string $stringtoslugify String to slugify
* @return string Slugified string
*/
function dolSlugify($stringtoslugify)
{
$slug = dol_string_unaccent($stringtoslugify);
// Convert special characters to their ASCII equivalents
if (function_exists('iconv')) {
$slug = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $slug);
}
// Convert to lowercase
$slug = strtolower($slug);
// Replace non-alphanumeric characters with hyphens
$slug = preg_replace('/[^a-z0-9]+/', '-', $slug);
// Remove leading and trailing hyphens
$slug = trim($slug, '-');
return $slug;
}
/**
* Returns text escaped for inclusion into javascript code
*
@ -2705,23 +2732,6 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
$out .= '<div class="inline-block floatright tabsElem">'.$morehtmlright.'</div>'; // Output right area first so when space is missing, text is in front of tabs and not under.
}
// Show title
/*
if (!empty($title) && $showtitle && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$limittitle = 30;
$out .= '<a class="tabTitle">';
if ($picto) {
$noprefix = $pictoisfullpath;
if (strpos($picto, 'fontawesome_') !== false) {
$noprefix = 1;
}
$out .= img_picto($title, ($noprefix ? '' : 'object_').$picto, '', $pictoisfullpath, 0, 0, '', 'imgTabTitle').' ';
}
$out .= '<span class="tabTitleText">'.dol_escape_htmltag(dol_trunc($title, $limittitle)).'</span>';
$out .= '</a>';
}
*/
// Show tabs
// Define max of key (max may be higher than sizeof because of hole due to module disabling some tabs).

View File

@ -513,7 +513,7 @@ function correctExifImageOrientation($fileSource, $fileDest, $quality = 95)
* @param int $maxWidth Maximum width of the thumbnail (-1=unchanged, 160 by default)
* @param int $maxHeight Maximum height of the thumbnail (-1=unchanged, 120 by default)
* @param string $extName Extension to differentiate thumb file name ('_small', '_mini')
* @param int $quality Quality of compression (0=worst, 100=best)
* @param int $quality Quality after compression (0=worst so better compression, 100=best so low or no compression)
* @param string $outdir Directory where to store thumb
* @param int $targetformat New format of target (IMAGETYPE_GIF, IMAGETYPE_JPG, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_WBMP ... or 0 to keep original format)
* @return string|int<0,0> Full path of thumb or '' if it fails or 'Error...' if it fails, or 0 if it fails to detect the type of image
@ -527,18 +527,14 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small',
dol_syslog("vignette file=".$file." extName=".$extName." maxWidth=".$maxWidth." maxHeight=".$maxHeight." quality=".$quality." outdir=".$outdir." targetformat=".$targetformat);
// Clean parameters
$file = trim($file);
$file = dol_sanitizePathName(trim($file));
// Check parameters
if (!$file) {
// If the file has not been indicated
return 'ErrorBadParameters';
} elseif (!file_exists($file)) {
// If the file passed in parameter does not exist
dol_syslog($langs->trans("ErrorFileNotFound", $file), LOG_ERR);
return $langs->trans("ErrorFileNotFound", $file);
} elseif (image_format_supported($file) < 0) {
dol_syslog('This file '.$file.' does not seem to be an image format file name.', LOG_WARNING);
dol_syslog('This file '.$file.' does not seem to be a supported image file name (bad extension).', LOG_WARNING);
return 'ErrorBadImageFormat';
} elseif (!is_numeric($maxWidth) || empty($maxWidth) || $maxWidth < -1) {
// If max width is incorrect (not numeric, empty, or less than 0)
@ -550,7 +546,13 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small',
return 'Error: Wrong value for parameter maxHeight';
}
$filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image
$filetoread = realpath(dol_osencode($file)); // Absolute canonical path of image
if (!file_exists($filetoread)) {
// If the file passed in parameter does not exist
dol_syslog($langs->trans("ErrorFileNotFound", $filetoread), LOG_ERR);
return $langs->trans("ErrorFileNotFound", $filetoread);
}
$infoImg = getimagesize($filetoread); // Get information like size and real format of image. Warning real format may be png when extension is .jpg
$imgWidth = $infoImg[0]; // Width of image
@ -759,7 +761,6 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small',
imagealphablending($imgThumb, false); // For compatibility on certain systems
$trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 127); // Keep transparent channel
$extImgTarget = '.png';
$newquality = $quality - 100;
$newquality = round(abs($quality - 100) * 9 / 100);
break;
case IMAGETYPE_BMP: // 6

View File

@ -599,9 +599,10 @@ function redirectToContainer($containerref, $containeraliasalt = '', $containeri
* @param string $containerref Path to file to include (must be a page from website root. Example: 'mypage.php' means 'mywebsite/mypage.php')
* @param int $once If set to 1, we use include_once.
* @param int $cachedelay A cache delay in seconds.
* @param string $cachekey Add a key into the name of the cache so the includeContainer can use different cache content for the same page.
* @return void
*/
function includeContainer($containerref, $once = 0, $cachedelay = 0)
function includeContainer($containerref, $once = 0, $cachedelay = 0, $cachekey = '')
{
global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running included containers.
global $includehtmlcontentopened;
@ -618,7 +619,7 @@ function includeContainer($containerref, $once = 0, $cachedelay = 0)
$fullpathcache = '';
// If we ask to use the cache delay
if ($cachedelay > 0 && !getDolGlobalString("WEBSITE_DISABLE_CACHE_OF_CONTAINERS")) {
$fullpathcache = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/website/temp/'.$websitekey.'-'.$websitepage->id.'-'.$containerref.'.cache';
$fullpathcache = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/website/temp/'.$websitekey.'-'.$websitepage->id.'-'.$containerref.($cachekey ? '-'.$cachekey: '').'.cache';
}
if (empty($includehtmlcontentopened)) {
@ -634,7 +635,7 @@ function includeContainer($containerref, $once = 0, $cachedelay = 0)
// We don't print info messages for pages of type library or service
if (!empty($websitepage->type_container) && !in_array($websitepage->type_container, array('library', 'service'))) {
print "\n".'<!-- include '.$websitekey.'/'.$containerref.(is_object($websitepage) ? ' parent id='.$websitepage->id : '').' level='.$includehtmlcontentopened.' -->'."\n";
print "\n".'<!-- include '.$websitekey.'/'.$containerref.($cachekey ? ' '.$cachekey: '').(is_object($websitepage) ? ' parent id='.$websitepage->id : '').' level='.$includehtmlcontentopened.' -->'."\n";
}
$tmpoutput = '';

View File

@ -174,6 +174,7 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
$tplcontent = '';
if (!isset($originalcontentonly)) {
// If we want to generate a page with some code to manage PHP content
$tplcontent .= "<?php // BEGIN PHP\n";
$tplcontent .= '$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__;'."\n";
$tplcontent .= "if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) {\n";
@ -190,73 +191,112 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
// If a language was forced on page, we use it, else we use the lang of visitor else the lang of web site
$tplcontent .= '<html'.($objectpage->lang ? ' lang="'.substr($objectpage->lang, 0, 2).'"' : '<?php echo $weblangs->shortlang ? \' lang="\'.$weblangs->shortlang.\'"\' : \'\' ?>').'>'."\n";
$tplcontent .= '<head>'."\n";
$tplcontent .= '<title>'.dol_string_nohtmltag($objectpage->title, 0, 'UTF-8').'</title>'."\n";
$tplcontent .= '<title>'.dol_string_nohtmltag($objectpage->title, 1, 'UTF-8').'</title>'."\n";
$tplcontent .= '<meta charset="utf-8">'."\n";
$tplcontent .= '<meta http-equiv="content-type" content="text/html; charset=utf-8" />'."\n";
$tplcontent .= '<meta name="robots" content="index, follow" />'."\n";
$tplcontent .= '<meta name="viewport" content="width=device-width, initial-scale=1.0">'."\n";
$tplcontent .= '<meta name="keywords" content="'.dol_string_nohtmltag($objectpage->keywords).'" />'."\n";
$tplcontent .= '<meta name="title" content="'.dol_string_nohtmltag($objectpage->title, 0, 'UTF-8').'" />'."\n";
$tplcontent .= '<meta name="description" content="'.dol_string_nohtmltag($objectpage->description, 0, 'UTF-8').'" />'."\n";
$tplcontent .= '<meta name="keywords" content="'.dol_string_nohtmltag($objectpage->keywords, 1, 'UTF-8').'" />'."\n";
$tplcontent .= '<meta name="title" content="'.dol_string_nohtmltag($objectpage->title, 1, 'UTF-8').'" />'."\n";
$tplcontent .= '<meta name="description" content="'.dol_string_nohtmltag($objectpage->description, 1, 'UTF-8').'" />'."\n";
$tplcontent .= '<meta name="generator" content="'.DOL_APPLICATION_TITLE.' '.DOL_VERSION.' (https://www.dolibarr.org)" />'."\n";
$tplcontent .= '<meta name="dolibarr:pageid" content="'.dol_string_nohtmltag((string) $objectpage->id).'" />'."\n";
$tplcontent .= '<meta name="dolibarr:pageid" content="'.((int) $objectpage->id).'" />'."\n";
// Add favicon
if (in_array($objectpage->type_container, array('page', 'blogpost'))) {
$tplcontent .= '<link rel="icon" type="image/png" href="/favicon.png" />'."\n";
}
// Add canonical reference
$listofaltlang = $object->otherlang;
// Add the link of the canonical reference
// Note: $object is website, $objectpage is website page
if ($object->virtualhost) {
$tplcontent .= '<link rel="canonical" href="'.(($objectpage->id == $object->fk_default_home) ? '/' : (($shortlangcode != substr($object->lang, 0, 2) ? '/'.$shortlangcode : '').'/'.$objectpage->pageurl.'.php')).'" />'."\n";
}
// Add translation reference (main language)
if ($object->isMultiLang()) {
// Add page "translation of"
$translationof = $objectpage->fk_page;
if ($translationof) {
$tmppage = new WebsitePage($db);
$tmppage->fetch($translationof);
if ($tmppage->id > 0) {
$tmpshortlangcode = '';
if ($tmppage->lang) {
$tmpshortlangcode = preg_replace('/[_-].*$/', '', $tmppage->lang); // en_US or en-US -> en
}
if (empty($tmpshortlangcode)) {
$tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en
}
if ($tmpshortlangcode != $shortlangcode) {
$tplcontent .= '<link rel="alternate" hreflang="'.$tmpshortlangcode.'" href="<?php echo $website->virtualhost; ?>'.($object->fk_default_home == $tmppage->id ? '/' : (($tmpshortlangcode != substr($object->lang, 0, 2)) ? '/'.$tmpshortlangcode : '').'/'.$tmppage->pageurl.'.php').'" />'."\n";
}
$canonicalurladdidlang = '';
if ($objectpage->lang) { // A language is forced on the page, it means we may have other language files with hard links into properties of page
$canonicalurl = (($objectpage->id == $object->fk_default_home) ? '/' : (($shortlangcode != substr($object->lang, 0, 2) ? '/'.$shortlangcode : '').'/'.$objectpage->pageurl.'.php'));
} else { // No language forced, it means the canonical is the one with
$canonicalurl = '/'.$objectpage->pageurl.'.php';
if ($object->lang && $listofaltlang) {
$tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en
// Add parameter ID required to be unique/canonical
$canonicalurladdidlang = '<?php echo GETPOSTINT("id") ? "?id=".GETPOSTINT("id")."&" : (GETPOSTINT("cat") ? "?cat=".GETPOSTINT("cat")."&" : "?") ?>';
$canonicalurladdidlang .= 'l=<?php echo $weblangs->shortlang ? $weblangs->shortlang : "'.$tmpshortlangcode.'"; ?>';
} else {
// Add parameter ID required to be unique/canonical
$canonicalurladdidlang = '<?php echo GETPOSTINT("id") ? "?id=".GETPOSTINT("id") : (GETPOSTINT("cat") ? "?cat=".GETPOSTINT("cat") : "") ?>';
}
}
// Add "has translation pages"
$sql = "SELECT rowid as id, lang, pageurl from ".MAIN_DB_PREFIX.'website_page where fk_page IN ('.$db->sanitize($objectpage->id.($translationof ? ", ".$translationof : '')).")";
$resql = $db->query($sql);
if ($resql) {
$num_rows = $db->num_rows($resql);
if ($num_rows > 0) {
while ($obj = $db->fetch_object($resql)) {
$tmpshortlangcode = '';
if ($obj->lang) {
$tmpshortlangcode = preg_replace('/[_-].*$/', '', $obj->lang); // en_US or en-US -> en
}
if ($tmpshortlangcode != $shortlangcode) {
$tplcontent .= '<link rel="alternate" hreflang="'.$tmpshortlangcode.'" href="<?php echo $website->virtualhost; ?>'.($object->fk_default_home == $obj->id ? '/' : (($tmpshortlangcode != substr($object->lang, 0, 2) ? '/'.$tmpshortlangcode : '')).'/'.$obj->pageurl.'.php').'" />'."\n";
$tplcontent .= '<link rel="canonical" href="<?php echo $website->virtualhost; ?>'.$canonicalurl.$canonicalurladdidlang.'" />'."\n";
// Add the link of alternate translation reference
if ($listofaltlang) { // If website has other languages to support
if ($objectpage->lang) { // A language is forced on the page, it means we may have other language files with hard links into properties of page
// Add page "translation of"
$translationof = $objectpage->fk_page;
if ($translationof) {
$tmppage = new WebsitePage($db);
$tmppage->fetch($translationof);
if ($tmppage->id > 0) {
$tmpshortlangcode = '';
if ($tmppage->lang) {
$tmpshortlangcode = preg_replace('/[_-].*$/', '', $tmppage->lang); // en_US or en-US -> en
}
if (empty($tmpshortlangcode)) {
$tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en
}
if ($tmpshortlangcode != $shortlangcode) {
$tplcontent .= '<link rel="alternate" hreflang="'.$tmpshortlangcode.'" href="<?php echo $website->virtualhost; ?>'.($object->fk_default_home == $tmppage->id ? '/' : (($tmpshortlangcode != substr($object->lang, 0, 2)) ? '/'.$tmpshortlangcode : '').'/'.$tmppage->pageurl.'.php').'" />'."\n";
}
}
}
// Add "has translation pages"
$sql = "SELECT rowid as id, lang, pageurl from ".MAIN_DB_PREFIX.'website_page where fk_page IN ('.$db->sanitize($objectpage->id.($translationof ? ", ".$translationof : '')).")";
$resql = $db->query($sql);
if ($resql) {
$num_rows = $db->num_rows($resql);
if ($num_rows > 0) {
while ($obj = $db->fetch_object($resql)) {
$tmpshortlangcode = '';
if ($obj->lang) {
$tmpshortlangcode = preg_replace('/[_-].*$/', '', $obj->lang); // en_US or en-US -> en
}
if ($tmpshortlangcode != $shortlangcode) {
$tplcontent .= '<link rel="alternate" hreflang="'.$tmpshortlangcode.'" href="<?php echo $website->virtualhost; ?>'.($object->fk_default_home == $obj->id ? '/' : (($tmpshortlangcode != substr($object->lang, 0, 2) ? '/'.$tmpshortlangcode : '')).'/'.$obj->pageurl.'.php').'" />'."\n";
}
}
}
} else {
dol_print_error($db);
}
// Add myself
$tplcontent .= '<?php if ($_SERVER["PHP_SELF"] == "'.(($object->fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '')).'/'.$objectpage->pageurl.'.php") { ?>'."\n";
$tplcontent .= '<link rel="alternate" hreflang="'.$shortlangcode.'" href="<?php echo $website->virtualhost; ?>'.(($object->fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '').'/'.$objectpage->pageurl.'.php').'" />'."\n";
$tplcontent .= '<?php } ?>'."\n";
} else {
$canonicalurl = '/'.$objectpage->pageurl.'.php';
$arrayofaltlang = explode(',', $listofaltlang);
foreach ($arrayofaltlang as $altlang) {
// Add parameter ID required to be unique/canonical
$canonicalurladdidlang = '<?php echo GETPOSTINT("id") ? "?id=".GETPOSTINT("id")."&" : (GETPOSTINT("cat") ? "?cat=".GETPOSTINT("cat")."&" : "?") ?>';
$canonicalurladdidlang .= 'l='.$altlang;
$tplcontent .= '<link rel="alternate" hreflang="'.$altlang.'" href="<?php echo $website->virtualhost; ?>'.$canonicalurl.$canonicalurladdidlang.'" />'."\n";
}
$tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en
$canonicalurladdidlang = '<?php echo GETPOSTINT("id") ? "?id=".GETPOSTINT("id")."&" : (GETPOSTINT("cat") ? "?cat=".GETPOSTINT("cat")."&" : "?") ?>';
$canonicalurladdidlang .= 'l='.$tmpshortlangcode;
$tplcontent .= '<link rel="alternate" hreflang="'.$tmpshortlangcode.'" href="<?php echo $website->virtualhost; ?>'.$canonicalurl.$canonicalurladdidlang.'" />'."\n";
}
} else {
dol_print_error($db);
}
// Add myself
$tplcontent .= '<?php if ($_SERVER["PHP_SELF"] == "'.(($object->fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '')).'/'.$objectpage->pageurl.'.php") { ?>'."\n";
$tplcontent .= '<link rel="alternate" hreflang="'.$shortlangcode.'" href="<?php echo $website->virtualhost; ?>'.(($object->fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '').'/'.$objectpage->pageurl.'.php').'" />'."\n";
$tplcontent .= '<?php } ?>'."\n";
}
// Add manifest.json. Do we have to add it only on home page ?
$tplcontent .= '<?php if ($website->use_manifest) { print \'<link rel="manifest" href="/manifest.json.php" />\'."\n"; } ?>'."\n";
$tplcontent .= '<!-- Include link to CSS file -->'."\n";
@ -278,7 +318,9 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
$tplcontent .= '</html>'."\n";
$tplcontent .= '<?php // BEGIN PHP'."\n";
$tplcontent .= '$tmp = ob_get_contents(); ob_end_clean();'."\n";
$tplcontent .= '$tmp = ob_get_contents(); ob_end_clean();'."\n"; // replace with ob_get_clean ?
// Old method for custom SEO
if (strpos($objectpage->content, '$__PAGE__TITLE__') !== false) {
$tplcontent .= '$tmp = preg_replace("/<title>.*?<\/title>/s", "<title>" . dol_escape_htmltag($__PAGE__TITLE__) . "</title>", $tmp);'."\n";
$tplcontent .= '$tmp = preg_replace("/<meta name=\"title\" content=\".*?\" \/>/s", "<meta name=\"title\" content=\"" . dol_string_nohtmltag($__PAGE__TITLE__) . "\" />", $tmp);';
@ -289,7 +331,19 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
if (strpos($objectpage->content, '$__PAGE__DESC__') !== false) {
$tplcontent .= '$tmp = preg_replace("/<meta name=\"description\" content=\".*?\" \/>/s", "<meta name=\"description\" content=\"" . dol_string_nohtmltag($__PAGE__DESC__) . "\" />", $tmp);';
}
$tplcontent .= 'dolWebsiteOutput($tmp, "html", '.$objectpage->id.'); dolWebsiteIncrementCounter('.$object->id.', "'.$objectpage->type_container.'", '.$objectpage->id.');'."\n";
// New method for custom SEO
if (strpos($objectpage->content, 'define("__SEO_PAGE_TITLE__"') !== false) {
$tplcontent .= '$tmp = preg_replace("/<title>.*?<\/title>/s", "<title>" . dol_escape_htmltag(constant("__SEO_PAGE_TITLE__")) . "</title>", $tmp);'."\n";
$tplcontent .= '$tmp = preg_replace("/<meta name=\"title\" content=\".*?\" \/>/s", "<meta name=\"title\" content=\"" . dol_string_nohtmltag(constant("__SEO_PAGE_TITLE__")) . "\" />", $tmp);';
}
if (strpos($objectpage->content, 'define("__SEO_PAGE_KEYWORDS__"') !== false) {
$tplcontent .= '$tmp = preg_replace("/<meta name=\"keywords\" content=\".*?\" \/>/s", "<meta name=\"keywords\" content=\"" . dol_string_nohtmltag(constant("__SEO_PAGE_KEYWORDS__")) . "\" />", $tmp);';
}
if (strpos($objectpage->content, 'define("__SEO_PAGE_DESC__"') !== false) {
$tplcontent .= '$tmp = preg_replace("/<meta name=\"description\" content=\".*?\" \/>/s", "<meta name=\"description\" content=\"" . dol_string_nohtmltag(constant("__SEO_PAGE_DESC__")) . "\" />", $tmp);';
}
$tplcontent .= 'dolWebsiteOutput($tmp, "html", '.((int) $objectpage->id).'); dolWebsiteIncrementCounter('.((int) $object->id).', "'.$objectpage->type_container.'", '.((int) $objectpage->id).');'."\n";
$tplcontent .= "// END PHP ?>\n";
} else {
$tplcontent .= "<?php // BEGIN PHP\n";

View File

@ -132,7 +132,7 @@ if ($massaction == 'preupdateprice') {
$formquestion = array();
$valuefield = '<div style="display: flex; align-items: center; justify-content: flex-end; padding-right: 150px">';
$valuefield .= '<input type="number" name="pricerate" id="pricerate" min="-100" value="0" style="width: 100px; text-align: right; margin-right: 10px" />%';
$valuefield .= '<input class="width50 right" type="text" name="pricerate" id="pricerate" min="-100" placeholder="0" value="" /> %';
$valuefield .= '</div>';
$formquestion[] = array(

View File

@ -49,7 +49,7 @@ create table llx_product_fournisseur_price
fk_supplier_price_expression integer, -- Link to the rule for dynamic price calculation
delivery_time_days integer,
supplier_reputation varchar(10),
packaging real DEFAULT NULL,
packaging real DEFAULT NULL, -- qty bought will be a multiple of this value
fk_multicurrency integer,
multicurrency_code varchar(3),
multicurrency_tx double(24,8) DEFAULT 1,

View File

@ -111,6 +111,7 @@ print 'Option clean_menus is '.(GETPOST('clean_menus', 'alpha') ? GETPOST('clean
print 'Option clean_orphelin_dir is '.(GETPOST('clean_orphelin_dir', 'alpha') ? GETPOST('clean_orphelin_dir', 'alpha') : 'undefined').'<br>'."\n";
print 'Option clean_product_stock_batch is '.(GETPOST('clean_product_stock_batch', 'alpha') ? GETPOST('clean_product_stock_batch', 'alpha') : 'undefined').'<br>'."\n";
print 'Option clean_perm_table is '.(GETPOST('clean_perm_table', 'alpha') ? GETPOST('clean_perm_table', 'alpha') : 'undefined').'<br>'."\n";
print 'Option clean_ecm_files_table is '.(GETPOST('clean_ecm_files_table', 'alpha') ? GETPOST('clean_ecm_files_table', 'alpha') : 'undefined').'<br>'."\n";
print 'Option repair_link_dispatch_lines_supplier_order_lines, is '.(GETPOST('repair_link_dispatch_lines_supplier_order_lines', 'alpha') ? GETPOST('repair_link_dispatch_lines_supplier_order_lines', 'alpha') : 'undefined').'<br>'."\n";
// Init data
print 'Option set_empty_time_spent_amount is '.(GETPOST('set_empty_time_spent_amount', 'alpha') ? GETPOST('set_empty_time_spent_amount', 'alpha') : 'undefined').'<br>'."\n";
@ -205,7 +206,7 @@ $conf->global->MAIN_ENABLE_LOG_TO_HTML = 1;
$oneoptionset = 0;
$oneoptionset = (GETPOST('standard', 'alpha') || GETPOST('restore_thirdparties_logos', 'alpha') || GETPOST('clean_linked_elements', 'alpha') || GETPOST('clean_menus', 'alpha')
|| GETPOST('clean_orphelin_dir', 'alpha') || GETPOST('clean_product_stock_batch', 'alpha') || GETPOST('set_empty_time_spent_amount', 'alpha') || GETPOST('rebuild_product_thumbs', 'alpha')
|| GETPOST('clean_perm_table', 'alpha')
|| GETPOST('clean_perm_table', 'alpha') || GETPOST('clean_ecm_files_table', 'alpha')
|| GETPOST('force_disable_of_modules_not_found', 'alpha')
|| GETPOST('force_utf8_on_tables', 'alpha') || GETPOST('force_utf8mb4_on_tables', 'alpha') || GETPOST('force_collation_from_conf_on_tables', 'alpha')
|| GETPOST('rebuild_sequences', 'alpha') || GETPOST('recalculateinvoicetotal', 'alpha'));
@ -1294,6 +1295,59 @@ if ($ok && GETPOST('clean_perm_table', 'alpha')) {
}
// clean_old_module_entries: Clean data into const when files of module were removed without being
if ($ok && GETPOST('clean_ecm_files_table', 'alpha')) {
print '<tr><td colspan="2"><br>*** Clean table ecm_files from lines of entries whose physical files does not exists anymore (emplemented for entity 1 only)</td></tr>';
$MAXTODELETE = 100;
$sql = "SELECT rowid, filename, filepath, entity from ".MAIN_DB_PREFIX."ecm_files";
$sql .= " WHERE entity = 1";
$sql .= " ORDER BY rowid ASC";
$nbfile = 0;
$nbfiletodelete = 0;
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
if ($num) {
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($resql);
if ($obj->rowid > 0) {
$filetocheck = DOL_DATA_ROOT.'/'.$obj->filepath.'/'.$obj->filename;
$nbfile++;
if (!dol_is_file($filetocheck) && !dol_is_file($filetocheck.'.noexe')) {
$nbfiletodelete++;
if ($nbfiletodelete <= $MAXTODELETE) {
print '<tr><td>Found line with id '.$obj->rowid.', entity '.$obj->entity.', file "'.$filetocheck.'" to delete';
if (GETPOST('clean_ecm_files_table', 'alpha') == 'confirmed') {
$sqldelete = "DELETE FROM ".MAIN_DB_PREFIX."ecm_files WHERE rowid = ".((int) $obj->rowid);
$resqldelete = $db->query($sqldelete);
if (!$resqldelete) {
dol_print_error($db);
}
print ' - deleted';
}
print '</td></tr>';
} else {
break;
}
}
}
$i++;
}
}
if ($nbfiletodelete > $MAXTODELETE) {
print '<tr><td>There is more than '.$MAXTODELETE.' invalid entries into ecm_files index table (among '.$nbfile.' analyzed) with no valid physical files. Run the page several time to process all of them.</td></tr>';
} else {
print '<tr><td>Nb of entries processed into ecm_files index table: '.$nbfile.', number of invalid record: '.$nbfiletodelete.'</td></tr>';
}
} else {
dol_print_error($db);
}
}
// force utf8 on tables
if ($ok && GETPOST('force_utf8_on_tables', 'alpha')) {

View File

@ -12,6 +12,7 @@ YourEMail=Email to receive payment confirmation
STRIPE_PAYONLINE_SENDEMAIL=Email notification after a payment attempt (success or fail)
Creditor=Creditor
PaymentCode=Payment code
StripeAutoRecordPayout=Enable the auto recording of payout (when Stripe do a payout and call the webhook IPN payout.create/payout.paid)
StripeDoPayment=Pay with Stripe
YouWillBeRedirectedOnStripe=You will be redirected on secured Stripe page to input you credit card information
Continue=Next

View File

@ -4,7 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2016-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2016-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
@ -33,6 +33,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php';
if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
/**
@ -83,7 +84,9 @@ if (empty($reshook)) {
$morehtmlright = '';
$form = new Form($db);
$formproject = new FormProjets($db);
if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
$title = $langs->trans("Loan").' - '.$langs->trans("Notes");
$help_url = 'EN:Module_Loan|FR:Module_Emprunt';

View File

@ -361,7 +361,7 @@ if (empty($reshook)) {
'SupplierProposal' => '/supplier_proposal/class/supplier_proposal.class.php',
);
//First, all core objects must update their tables
// First, all core objects must update their tables
foreach ($objects as $object_name => $object_file) {
require_once DOL_DOCUMENT_ROOT.$object_file;
@ -406,13 +406,30 @@ if (empty($reshook)) {
}
if (!$error) {
// We finally remove the old product
// TODO merge attached files from old product into new one before delete
// Delete the product
if ($productOrigin->delete($user) < 1) {
$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->product->multidir_output[$productOrigin->entity])) {
$srcdir = $conf->product->multidir_output[$productOrigin->entity]."/".$productOrigin->ref;
$destdir = $conf->product->multidir_output[$object->entity]."/".$object->ref;
if (dol_is_dir($srcdir)) {
$dirlist = dol_dir_list($srcdir, 'files', 1);
foreach ($dirlist as $filetomove) {
$destfile = $destdir.'/'.$filetomove['relativename'];
//var_dump('Move file '.$filetomove['relativename'].' into '.$destfile);
dol_move($filetomove['fullname'], $destfile, '0', 0, 0, 1);
}
//exit;
}
}
}
if (!$error) {
setEventMessages($langs->trans('ProductsMergeSuccess'), null, 'mesgs');
$db->commit();

View File

@ -132,6 +132,22 @@ if (empty($validpaymentmethod)) {
$object = new stdClass(); // For triggers
/** @var CommonObject $object */
$error = 0;
// Check if we have redirtodomain to do.
$ws_virtuelhost = null;
$doactionsthenredirect = 0;
if ($ws) {
$doactionsthenredirect = 1;
include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php';
$website = new Website($db);
$result = $website->fetch(0, $ws);
if ($result > 0) {
$ws_virtuelhost = $website->virtualhost;
}
}
/*
* Actions
*/
@ -144,13 +160,6 @@ $object = new stdClass(); // For triggers
* View
*/
// Check if we have redirtodomain to do.
$doactionsthenredirect = 0;
if ($ws) {
$doactionsthenredirect = 1;
}
dol_syslog("Callback url when an online payment is refused or canceled. query_string=".(empty($_SERVER["QUERY_STRING"]) ? '' : $_SERVER["QUERY_STRING"])." script_uri=".(empty($_SERVER["SCRIPT_URI"]) ? '' : $_SERVER["SCRIPT_URI"]), LOG_DEBUG, 0, '_payment');
$tracepost = "";
@ -333,6 +342,11 @@ $db->close();
if (!empty($doactionsthenredirect)) {
// Redirect to an error page
// Paymentko page must be created for the specific website
$ext_urlko = DOL_URL_ROOT.'/public/website/index.php?website='.urlencode($ws).'&pageref=paymentko&fulltag='.$FULLTAG;
if (!defined('USEDOLIBARRSERVER') && !empty($ws_virtuelhost)) {
$ext_urlko = $ws_virtuelhost . '/paymentko.php?fulltag='.$FULLTAG;
} else {
$ext_urlko = DOL_URL_ROOT.'/public/website/index.php?website='.urlencode($ws).'&pageref=paymentko&fulltag='.$FULLTAG;
}
print "<script>window.top.location.href = '".dol_escape_js($ext_urlko)."';</script>";
}

View File

@ -169,6 +169,7 @@ $ErrorCode = $ErrorShortMsg = $ErrorLongMsg = $ErrorSeverityCode = '';
$object = new stdClass(); // For triggers
/** @var CommonObject $object */
$error = 0;

View File

@ -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++;

View File

@ -1551,7 +1551,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</td>';
print '</tr>';
print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td>';
// Customer code
print '<tr>';
print '<td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td>';
print '<table class="nobordernopadding"><tr><td>';
$tmpcode = $object->code_client;
if (empty($tmpcode) && !empty($modCodeClient->code_auto)) {
@ -1564,14 +1566,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</td></tr></table>';
print '</td>';
// 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 '<td colspan="2"></td>';
print '</tr><tr>';
}
print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td>';
print '<td>';
print '<table class="nobordernopadding"><tr>';
print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td>';
print '<table class="nobordernopadding"><tr><td>';
$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 '<tr class="marginbottomlarge height50"><td class="titlefieldcreate">'.$form->editfieldkey('', 'customerprospect', '', $object, 0, 'string', '', 0).'</td>';
print '<td class="maxwidthonsmartphone" colspan="3">';
print '<tr class="marginbottomlarge height50">';
if ($conf->browser->layout != 'phone') {
print '<td class="titlefieldcreate">'.$form->editfieldkey('', 'customerprospect', '', $object, 0, 'string', '', 0).'</td>';
}
print '<td class="maxwidthonsmartphone"'.($conf->browser->layout != 'phone' ? 'colspan="3"' : 'colspan="2"').'>';
if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS')) {
print '<span id="spannature1" class="spannature prospect-back paddinglarge marginrightonly"><label for="prospectinput" class="valignmiddle">'.$langs->trans("Prospect").'<input id="prospectinput" class="flat checkforselect marginleftonly valignmiddle" type="checkbox" name="prospect" value="2"'.($selectedprospect ? ' checked="checked"' : '').'></label></span>';
@ -2393,7 +2398,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
print '</td>';
print '</tr>';
print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td>';
print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td colspan="3">';
print '<table class="nobordernopadding"><tr><td>';
$tmpcode = $object->code_client;
if (empty($tmpcode) && !empty($modCodeClient->code_auto)) {
@ -2410,7 +2416,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</tr><tr>';
}
print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td>';
print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td colspan="3">';
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 '<table class="nobordernopadding"><tr><td>';
@ -2437,12 +2443,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
// Status
print '<tr><td>'.$form->editfieldkey('Status', 'status', '', $object, 0).'</td><td colspan="3">';
print '<tr><td>'.$form->editfieldkey('Status', 'status', '', $object, 0).'</td><td'.($conf->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 '</td></tr>';
$colspan = ($conf->browser->layout == 'phone' ? 2 : 4);
print '<tr><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>&nbsp;</td></tr>';
//$colspan = ($conf->browser->layout == 'phone' ? 2 : 4);
$colspan = 4;
print '<tr><td colspan="'.$colspan.'">&nbsp;</td></tr>';
// Address
print '<tr><td class="tdtop">'.$form->editfieldkey('Address', 'address', '', $object, 0).'</td>';
@ -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 '<tr><td>'.$langs->trans("ProductAccountancySellCode").'</td>';
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancySellCode").'</td>';
print '<td>';
print $formaccounting->select_account($object->accountancy_code_sell, 'accountancy_code_sell', 1, array(), 1, 1);
print '</td></tr>';
// Accountancy_code_buy
print '<tr><td>'.$langs->trans("ProductAccountancyBuyCode").'</td>';
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancyBuyCode").'</td>';
print '<td>';
print $formaccounting->select_account($object->accountancy_code_buy, 'accountancy_code_buy', 1, array(), 1, 1);
print '</td></tr>';
} else { // For external software
// Accountancy_code_sell
print '<tr><td>'.$langs->trans("ProductAccountancySellCode").'</td>';
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancySellCode").'</td>';
print '<td><input name="accountancy_code_sell" class="maxwidth200" value="'.$object->accountancy_code_sell.'">';
print '</td></tr>';
// Accountancy_code_buy
print '<tr><td>'.$langs->trans("ProductAccountancyBuyCode").'</td>';
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancyBuyCode").'</td>';
print '<td><input name="accountancy_code_buy" class="maxwidth200" value="'.$object->accountancy_code_buy.'">';
print '</td></tr>';
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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, '');
}

View File

@ -379,18 +379,30 @@ print '<input class="minwidth300" type="text" name="ONLINE_PAYMENT_CREDITOR" val
print ' &nbsp; <span class="opacitymedium">'.$langs->trans("Example").': '.$mysoc->name.'</span>';
print '</td></tr>';
print '<tr class="oddeven"><td>';
print $langs->trans("StripeUserAccountForActions").'</td><td>';
print img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers(getDolGlobalString('STRIPE_USER_ACCOUNT_FOR_ACTIONS'), 'STRIPE_USER_ACCOUNT_FOR_ACTIONS', 0);
print '</td></tr>';
print '<tr class="oddeven"><td>';
print $langs->trans("BankAccount").'</td><td>';
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
$form->select_comptes(getDolGlobalString('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'), 'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1);
print '</td></tr>';
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { // What is this for ?
// Param to record automatically payouts (received from IPN payout.payed and payout.created)
print '<tr class="oddeven"><td>';
print $langs->trans("StripeAutoRecordPayout").'</td><td>';
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 '</td></tr>';
if (getDolGlobalInt('STRIPE_AUTO_RECORD_PAYOUT')) {
print '<tr class="oddeven"><td>';
print $langs->trans("StripeUserAccountForActions").'</td><td>';
print img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers(getDolGlobalString('STRIPE_USER_ACCOUNT_FOR_ACTIONS'), 'STRIPE_USER_ACCOUNT_FOR_ACTIONS', 0);
print '</td></tr>';
print '<tr class="oddeven"><td>';
print $langs->trans("BankAccountForBankTransfer").'</td><td>';
print img_picto('', 'bank_account', 'class="pictofixedwidth"');

View File

@ -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;
<?php } ?>
opacity: 0.95;
<?php if (isset($conf->global->THEME_SATURATE_RATIO)) { ?>
filter: saturate(<?php echo $conf->global->THEME_SATURATE_RATIO; ?>);
<?php if (getDolGlobalString('THEME_SATURATE_RATIO')) { ?>
filter: saturate(<?php echo getDolGlobalString('THEME_SATURATE_RATIO'); ?>);
<?php } ?>
}

View File

@ -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";

View File

@ -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;
<?php if (isset($conf->global->THEME_SATURATE_RATIO)) { ?>
filter: saturate(<?php echo $conf->global->THEME_SATURATE_RATIO; ?>);
<?php if (getDolGlobalString('THEME_SATURATE_RATIO')) { ?>
filter: saturate(<?php echo getDolGlobalString('THEME_SATURATE_RATIO'); ?>);
<?php } ?>
}
@ -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{

View File

@ -901,25 +901,31 @@ class Website extends CommonObject
$result = '';
$label = '<u>'.$langs->trans("WebSite").'</u>';
$label = '<u>'.img_picto('', 'website', 'class="pictofixedwidth"').$langs->trans("WebSite").'</u>';
$label .= '<br>';
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref.'<br>';
$label .= '<b>'.$langs->trans('MainLanguage').':</b> '.$this->lang;
$linkstart = '<a href="'.DOL_URL_ROOT.'/website/card.php?id='.$this->id.'"';
// Links for internal access
/*
$linkstart = '<a href="'.DOL_URL_ROOT.'/website/index.php?website='.urlencode($this->ref).'"';
$linkstart .= ($notooltip ? '' : ' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip'.($morecss ? ' '.$morecss : '').'"');
$linkstart .= '>';
$linkend = '</a>';
$linkstart = $linkend = '';
if ($withpicto) {
$result .= ($linkstart.img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? '' : 'class="classfortooltip"')).$linkend);
if ($withpicto != 2) {
$result .= ' ';
}
*/
if (!empty($this->virtualhost)) {
$linkstart = '<a target="_blank" rel="noopener" href="'.$this->virtualhost.'">';
$linkend = '</a>';
} 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;
}