Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts: htdocs/core/db/DoliDB.class.php htdocs/resource/list.php
This commit is contained in:
commit
7e68f9e013
@ -100,7 +100,7 @@ if (empty($conf->use_javascript_ajax)) {
|
||||
print $form->selectarray("activate_RESOURCE_USE_SEARCH_TO_SELECT", $arrval, $conf->global->RESOURCE_USE_SEARCH_TO_SELECT);
|
||||
print '</td>';
|
||||
print '<td class="right">';
|
||||
print '<input type="submit" class="button" name="RESOURCE_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
|
||||
print '<input type="submit" class="button small" name="RESOURCE_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
@ -108,7 +108,7 @@ print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans('DisabledResourceLinkUser').'</td>';
|
||||
print '<td>';
|
||||
print '<td class="right">';
|
||||
echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_USER');
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
@ -117,7 +117,7 @@ print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans('DisabledResourceLinkContact').'</td>';
|
||||
print '<td>';
|
||||
print '<td class="right">';
|
||||
echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_THIPARTY');
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
@ -126,7 +126,7 @@ print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans('EnableResourceUsedInEventCheck').'</td>';
|
||||
print '<td>';
|
||||
print '<td class="right">';
|
||||
echo ajax_constantonoff('RESOURCE_USED_IN_EVENT_CHECK');
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
|
||||
@ -319,16 +319,22 @@ abstract class DoliDB implements Database
|
||||
* Return first result from query as object
|
||||
* Note : This method executes a given SQL query and retrieves the first row of results as an object. It should only be used with SELECT queries
|
||||
* Dont add LIMIT to your query, it will be added by this method
|
||||
* @param string $sql the sql query string
|
||||
* @return bool| object
|
||||
*
|
||||
* @param string $sql The sql query string
|
||||
* @return bool|int|object False on failure, 0 on empty, object on success
|
||||
*/
|
||||
public function getRow($sql)
|
||||
{
|
||||
$sql .= ' LIMIT 1;';
|
||||
$sql .= ' LIMIT 1';
|
||||
|
||||
$res = $this->query($sql);
|
||||
if ($res) {
|
||||
return $this->fetch_object($res);
|
||||
$obj = $this->fetch_object($res);
|
||||
if ($obj) {
|
||||
return $obj;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@ -64,47 +64,6 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
|
||||
$filter = array();
|
||||
|
||||
$param = '';
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.urlencode($limit);
|
||||
}
|
||||
|
||||
if ($search_ref != '') {
|
||||
$param .= '&search_ref='.urlencode($search_ref);
|
||||
$filter['t.ref'] = $search_ref;
|
||||
}
|
||||
if ($search_type != '') {
|
||||
$param .= '&search_type='.urlencode($search_type);
|
||||
$filter['ty.label'] = $search_type;
|
||||
}
|
||||
|
||||
// Add $param from extra fields
|
||||
foreach ($search_array_options as $key => $val) {
|
||||
$crit = $val;
|
||||
$tmpkey = preg_replace('/search_options_/', '', $key);
|
||||
$typ = $extrafields->attributes[$object->table_element]['type'][$tmpkey];
|
||||
if ($val != '') {
|
||||
$param .= '&search_options_'.$tmpkey.'='.urlencode($val);
|
||||
}
|
||||
$mode_search = 0;
|
||||
if (in_array($typ, array('int', 'double', 'real'))) {
|
||||
$mode_search = 1; // Search on a numeric
|
||||
}
|
||||
if (in_array($typ, array('sellist', 'link')) && $crit != '0' && $crit != '-1') {
|
||||
$mode_search = 2; // Search on a foreign key int
|
||||
}
|
||||
if ($crit != '' && (!in_array($typ, array('select', 'sellist')) || $crit != '0') && (!in_array($typ, array('link')) || $crit != '-1')) {
|
||||
$filter['ef.'.$tmpkey] = natural_search('ef.'.$tmpkey, $crit, $mode_search);
|
||||
}
|
||||
}
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
|
||||
|
||||
$hookmanager->initHooks(array('resourcelist'));
|
||||
|
||||
if (empty($sortorder)) {
|
||||
@ -158,9 +117,17 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
||||
|
||||
|
||||
/*
|
||||
* Action
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel', 'alpha')) {
|
||||
$action = 'list';
|
||||
$massaction = '';
|
||||
}
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
@ -174,8 +141,42 @@ if ($reshook < 0) {
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
//$help_url="EN:Module_MyObject|FR:Module_MyObject_FR|ES:Módulo_MyObject";
|
||||
$help_url = '';
|
||||
$pagetitle = $langs->trans('ResourcePageIndex');
|
||||
llxHeader('', $pagetitle, '');
|
||||
llxHeader('', $pagetitle, $help_url);
|
||||
|
||||
|
||||
$sql = '';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
|
||||
$param = '';
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.urlencode($limit);
|
||||
}
|
||||
|
||||
if ($search_ref != '') {
|
||||
$param .= '&search_ref='.urlencode($search_ref);
|
||||
$filter['t.ref'] = $search_ref;
|
||||
}
|
||||
if ($search_type != '') {
|
||||
$param .= '&search_type='.urlencode($search_type);
|
||||
$filter['ty.label'] = $search_type;
|
||||
}
|
||||
|
||||
// Including the previous script generate the correct SQL filter for all the extrafields
|
||||
// we are playing with the behaviour of the Dolresource::fetch_all() by generating a fake
|
||||
// extrafields filter key to make it works
|
||||
$filter['ef.resource'] = $sql;
|
||||
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
|
||||
|
||||
// Confirmation suppression resource line
|
||||
if ($action == 'delete_resource') {
|
||||
@ -185,6 +186,7 @@ if ($action == 'delete_resource') {
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage);
|
||||
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
|
||||
@ -511,7 +511,7 @@ class ProductCombination
|
||||
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||
for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) {
|
||||
if ($parent->multiprices[$i] != '' || isset($this->combination_price_levels[$i]->variation_price)) {
|
||||
$new_type = $parent->multiprices_base_type[$i];
|
||||
$new_type = empty($parent->multiprices_base_type[$i]) ? 'HT' : $parent->multiprices_base_type[$i];
|
||||
$new_min_price = $parent->multiprices_min[$i];
|
||||
$variation_price = floatval(!isset($this->combination_price_levels[$i]->variation_price) ? $this->variation_price : $this->combination_price_levels[$i]->variation_price);
|
||||
$variation_price_percentage = floatval(!isset($this->combination_price_levels[$i]->variation_price_percentage) ? $this->variation_price_percentage : $this->combination_price_levels[$i]->variation_price_percentage);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user