2
0
forked from Wavyzz/dolibarr

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

Conflicts:
	htdocs/product/index.php
This commit is contained in:
Laurent Destailleur
2021-07-07 02:09:53 +02:00
4 changed files with 21 additions and 14 deletions

View File

@@ -138,16 +138,18 @@ if (empty($action) && !GETPOSTISSET('action')) {
if ($action == 'default') { // When action is default, we want a calendar view and not the list if ($action == 'default') { // When action is default, we want a calendar view and not the list
$action = (($defaultview != 'show_list') ? $defaultview : 'show_month'); $action = (($defaultview != 'show_list') ? $defaultview : 'show_month');
} }
if (GETPOST('viewcal', 'restricthtml') && GETPOST('action', 'alpha') != 'show_day' && GETPOST('action', 'alpha') != 'show_week') { if (GETPOST('viewcal', 'int') && GETPOST('action', 'alpha') != 'show_day' && GETPOST('action', 'alpha') != 'show_week') {
$action = 'show_month'; $day = ''; $action = 'show_month'; $day = '';
} // View by month } // View by month
if (GETPOST('viewweek', 'restricthtml') || GETPOST('action', 'alpha') == 'show_week') { if (GETPOST('viewweek', 'int') || GETPOST('action', 'alpha') == 'show_week') {
$action = 'show_week'; $week = ($week ? $week : date("W")); $day = ($day ? $day : date("d")); $action = 'show_week'; $week = ($week ? $week : date("W")); $day = ($day ? $day : date("d"));
} // View by week } // View by week
if (GETPOST('viewday', 'restricthtml') || GETPOST('action', 'alpha') == 'show_day') { if (GETPOST('viewday', 'int') || GETPOST('action', 'alpha') == 'show_day') {
$action = 'show_day'; $day = ($day ? $day : date("d")); $action = 'show_day'; $day = ($day ? $day : date("d"));
} // View by day } // View by day
$object = new ActionComm($db);
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('agenda', 'other', 'commercial')); $langs->loadLangs(array('agenda', 'other', 'commercial'));
@@ -197,6 +199,7 @@ if (GETPOST("viewperuser", 'alpha') || $action == 'show_peruser') {
exit; exit;
} }
/*
if ($action == 'delete_action') { if ($action == 'delete_action') {
$event = new ActionComm($db); $event = new ActionComm($db);
$event->fetch($actionid); $event->fetch($actionid);
@@ -206,6 +209,7 @@ if ($action == 'delete_action') {
$result = $event->delete(); $result = $event->delete();
} }
*/
/* /*
@@ -484,25 +488,25 @@ $viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoaction
//$viewmode .= '</span>'; //$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>'; $viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
$viewmode .= '<a class="btnTitle'.($action == 'show_month' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">'; $viewmode .= '<a class="btnTitle'.($action == 'show_month' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.(isset($object->datep) ? dol_print_date($object->datep, '%Y') : $year).'&month='.(isset($object->datep) ? dol_print_date($object->datep, '%m') : $month).'&day='.(isset($object->datep) ? dol_print_date($object->datep, '%d') : $day).$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">'; //$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"'); $viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"');
//$viewmode .= '</span>'; //$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewCal").'</span></a>'; $viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewCal").'</span></a>';
$viewmode .= '<a class="btnTitle'.($action == 'show_week' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">'; $viewmode .= '<a class="btnTitle'.($action == 'show_week' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.(isset($object->datep) ? dol_print_date($object->datep, '%Y') : $year).'&month='.(isset($object->datep) ? dol_print_date($object->datep, '%m') : $month).'&day='.(isset($object->datep) ? dol_print_date($object->datep, '%d') : $day).$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">'; //$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"'); $viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"');
//$viewmode .= '</span>'; //$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewWeek").'</span></a>'; $viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewWeek").'</span></a>';
$viewmode .= '<a class="btnTitle'.($action == 'show_day' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">'; $viewmode .= '<a class="btnTitle'.($action == 'show_day' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.(isset($object->datep) ? dol_print_date($object->datep, '%Y') : $year).'&month='.(isset($object->datep) ? dol_print_date($object->datep, '%m') : $month).'&day='.(isset($object->datep) ? dol_print_date($object->datep, '%d') : $day).$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">'; //$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"'); $viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"');
//$viewmode .= '</span>'; //$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>'; $viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">'; $viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.(isset($object->datep) ? dol_print_date($object->datep, '%Y') : $year).'&month='.(isset($object->datep) ? dol_print_date($object->datep, '%m') : $month).'&day='.(isset($object->datep) ? dol_print_date($object->datep, '%d') : $day).$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">'; //$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"'); $viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
//$viewmode .= '</span>'; //$viewmode .= '</span>';
@@ -939,6 +943,7 @@ if ($showbirthday) {
} }
} }
// LEAVE CALENDAR
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status"; $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status";
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u"; $sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.rowid = x.fk_user"; $sql .= " WHERE u.rowid = x.fk_user";
@@ -1877,7 +1882,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$cacheusers[$tmpid] = $newuser; $cacheusers[$tmpid] = $newuser;
} }
$listofusertoshow .= '<br>'.$cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom'); $listofusertoshow = '';
$listofusertoshow .= '<br>'.$cacheusers[$tmpid]->getNomUrl(-1, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom');
print $listofusertoshow; print $listofusertoshow;
} else { // Other calendar } else { // Other calendar
// Picto // Picto

View File

@@ -779,7 +779,7 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options =
do { do {
$oldstringtoclean = $out; $oldstringtoclean = $out;
if (!empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) && $check != 'restricthtmlallowunvalid') { if (!empty($out) && !empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) && $check != 'restricthtmlallowunvalid') {
try { try {
$dom = new DOMDocument; $dom = new DOMDocument;
$dom->loadHTML($out, LIBXML_ERR_NONE|LIBXML_HTML_NOIMPLIED|LIBXML_HTML_NODEFDTD|LIBXML_NONET|LIBXML_NOWARNING|LIBXML_NOXMLDECL); $dom->loadHTML($out, LIBXML_ERR_NONE|LIBXML_HTML_NOIMPLIED|LIBXML_HTML_NODEFDTD|LIBXML_NONET|LIBXML_NOWARNING|LIBXML_NOXMLDECL);

View File

@@ -4955,7 +4955,7 @@ function migrate_export_import_profiles($mode = 'export')
if ($oldfield != $newfield || $oldfilter != $newfilter) { if ($oldfield != $newfield || $oldfilter != $newfilter) {
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX.$mode."_model SET field = '".$db->escape($newfield)."'"; $sqlupd = 'UPDATE '.MAIN_DB_PREFIX.$mode."_model SET field = '".$db->escape($newfield)."'";
if ($mode == 'export') { if ($mode == 'export') {
$sql .= ", filter = '".$db->escape($newfilter)."'"; $sqlupd .= ", filter = '".$db->escape($newfilter)."'";
} }
$sqlupd .= ' WHERE rowid='.$obj->rowid; $sqlupd .= ' WHERE rowid='.$obj->rowid;
$resultstring .= '<tr class="trforrunsql" style=""><td class="wordbreak" colspan="4">'.$sqlupd."</td></tr>\n"; $resultstring .= '<tr class="trforrunsql" style=""><td class="wordbreak" colspan="4">'.$sqlupd."</td></tr>\n";

View File

@@ -105,7 +105,8 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>'; print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
} }
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="18"></td>'; print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td>';
print '<td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="18"></td>';
if ($i == 0) { if ($i == 0) {
print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>'; print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
} }
@@ -336,11 +337,11 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us
$product_static->status_buy = $objp->tobuy; $product_static->status_buy = $objp->tobuy;
$product_static->status_batch = $objp->tobatch; $product_static->status_batch = $objp->tobatch;
//Multilangs // Multilangs
if (!empty($conf->global->MAIN_MULTILANGS)) { if (!empty($conf->global->MAIN_MULTILANGS)) {
$sql = "SELECT label"; $sql = "SELECT label";
$sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
$sql .= " WHERE fk_product=".$objp->rowid; $sql .= " WHERE fk_product=".((int) $objp->rowid);
$sql .= " AND lang='".$db->escape($langs->getDefaultLang())."'"; $sql .= " AND lang='".$db->escape($langs->getDefaultLang())."'";
$resultd = $db->query($sql); $resultd = $db->query($sql);
@@ -372,7 +373,7 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us
$objp->price = $price_result; $objp->price = $price_result;
} }
} }
print '<td class="nowrap right">'; print '<td class="nowraponall amount right">';
if (isset($objp->price_base_type) && $objp->price_base_type == 'TTC') { if (isset($objp->price_base_type) && $objp->price_base_type == 'TTC') {
print price($objp->price_ttc).' '.$langs->trans("TTC"); print price($objp->price_ttc).' '.$langs->trans("TTC");
} else { } else {