Debug v17
This commit is contained in:
parent
97ccdc9207
commit
e9a3c37b89
@ -119,7 +119,7 @@ if ($action == 'add' && $permissiontoadd) {
|
|||||||
$object->label = trim($label);
|
$object->label = trim($label);
|
||||||
$object->type = trim($exporttype);
|
$object->type = trim($exporttype);
|
||||||
$object->type_declaration = $type_declaration;
|
$object->type_declaration = $type_declaration;
|
||||||
$object->subscription = (int) $subscription;
|
//$object->subscription = (int) $subscription;
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
// $ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
// $ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||||
|
|||||||
@ -47,17 +47,29 @@ class IntracommReport extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $fk_element = 'fk_intracommreport';
|
public $fk_element = 'fk_intracommreport';
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string declaration number
|
|
||||||
*/
|
|
||||||
public $declaration_number;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0 = No test on entity, 1 = Test with field entity, 2 = Test with link by societe
|
* 0 = No test on entity, 1 = Test with field entity, 2 = Test with link by societe
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $ismultientitymanaged = 1;
|
public $ismultientitymanaged = 1;
|
||||||
|
|
||||||
|
public $picto = 'intracommreport';
|
||||||
|
|
||||||
|
|
||||||
|
public $label; // ref ???
|
||||||
|
|
||||||
|
public $period;
|
||||||
|
|
||||||
|
public $declaration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string declaration number
|
||||||
|
*/
|
||||||
|
public $declaration_number;
|
||||||
|
|
||||||
|
public $type_declaration; // deb or des
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DEB - Product
|
* DEB - Product
|
||||||
*/
|
*/
|
||||||
@ -73,6 +85,7 @@ class IntracommReport extends CommonObject
|
|||||||
'expedition'=>'Expédition'
|
'expedition'=>'Expédition'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
|
|||||||
@ -144,21 +144,14 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
|
|||||||
// Security check
|
// Security check
|
||||||
if ($search_type == '0') {
|
if ($search_type == '0') {
|
||||||
$result = restrictedArea($user, 'produit', '', '', '', '', '', 0);
|
$result = restrictedArea($user, 'produit', '', '', '', '', '', 0);
|
||||||
|
|
||||||
$permissiontoread = $user->rights->produit->lire;
|
|
||||||
$permissiontodelete = $user->rights->produit->supprimer;
|
|
||||||
} elseif ($search_type == '1') {
|
} elseif ($search_type == '1') {
|
||||||
$result = restrictedArea($user, 'service', '', '', '', '', '', 0);
|
$result = restrictedArea($user, 'service', '', '', '', '', '', 0);
|
||||||
|
|
||||||
$permissiontoread = $user->rights->service->lire;
|
|
||||||
$permissiontodelete = $user->rights->service->supprimer;
|
|
||||||
} else {
|
} else {
|
||||||
$result = restrictedArea($user, 'produit|service', '', '', '', '', '', 0);
|
$result = restrictedArea($user, 'produit|service', '', '', '', '', '', 0);
|
||||||
|
|
||||||
$permissiontoread = $user->rights->produit->lire;
|
|
||||||
$permissiontodelete = $user->rights->produit->supprimer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$permissiontoread = $user->rights->intracommreport->read;
|
||||||
|
$permissiontodelete = $user->rights->intracommreport->delete;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -216,25 +209,21 @@ $formother = new FormOther($db);
|
|||||||
|
|
||||||
$title = $langs->trans('IntracommReportList'.$type);
|
$title = $langs->trans('IntracommReportList'.$type);
|
||||||
|
|
||||||
$sql = 'SELECT DISTINCT i.rowid, i.type_declaration, i.type_export, i.periods, i.mode, i.entity';
|
$sqlfields = 'i.rowid, i.type_declaration, i.type_export, i.periods, i.mode, i.entity';
|
||||||
|
$sql = 'SELECT '.$sqlfields;
|
||||||
/*
|
/*
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= $hookmanager->resPrint;
|
$sql .= $hookmanager->resPrint;
|
||||||
|
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'intracommreport as i';
|
$sql .= ' FROM '.MAIN_DB_PREFIX.'intracommreport as i';
|
||||||
|
|
||||||
// if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."intracommreport_extrafields as ef on (i.rowid = ef.fk_object)";
|
// if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."intracommreport_extrafields as ef on (i.rowid = ef.fk_object)";
|
||||||
|
|
||||||
$sql .= ' WHERE i.entity IN ('.getEntity('intracommreport').')';
|
$sql .= ' WHERE i.entity IN ('.getEntity('intracommreport').')';
|
||||||
|
|
||||||
if ($sall) {
|
if ($sall) {
|
||||||
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
||||||
}
|
}
|
||||||
@ -279,217 +268,243 @@ $parameters = array();
|
|||||||
$reshook = $hookmanager->executeHooks('printFieldSelect', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= $hookmanager->resPrint;
|
$sql .= $hookmanager->resPrint;
|
||||||
|
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
|
||||||
|
|
||||||
|
// Count total nb of records
|
||||||
$nbtotalofrecords = '';
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
$result = $db->query($sql);
|
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||||
$nbtotalofrecords = $db->num_rows($result);
|
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||||
|
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||||
|
$resql = $db->query($sqlforcount);
|
||||||
|
if ($resql) {
|
||||||
|
$objforcount = $db->fetch_object($resql);
|
||||||
|
$nbtotalofrecords = $objforcount->nbtotalofrecords;
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||||
$page = 0;
|
$page = 0;
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
}
|
}
|
||||||
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql .= $db->plimit($limit + 1, $offset);
|
// Complete request and execute it with limit
|
||||||
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
if ($limit) {
|
||||||
|
$sql .= $db->plimit($limit + 1, $offset);
|
||||||
|
}
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
if (!$resql) {
|
||||||
|
dol_print_error($db);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
if ($resql) {
|
$num = $db->num_rows($resql);
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
|
|
||||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
$helpurl = 'EN:Module_IntracommReport|FR:Module_ProDouane';
|
||||||
|
llxHeader('', $title, $helpurl, '');
|
||||||
|
|
||||||
$helpurl = 'EN:Module_IntracommReport|FR:Module_ProDouane';
|
// Displays product removal confirmation
|
||||||
llxHeader('', $title, $helpurl, '');
|
if (GETPOST('delreport')) {
|
||||||
|
|
||||||
// Displays product removal confirmation
|
|
||||||
if (GETPOST('delreport')) {
|
|
||||||
setEventMessages($langs->trans("IntracommReportDeleted", GETPOST('delreport')), null, 'mesgs');
|
setEventMessages($langs->trans("IntracommReportDeleted", GETPOST('delreport')), null, 'mesgs');
|
||||||
}
|
}
|
||||||
|
|
||||||
$param = '';
|
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
|
||||||
|
$param = '';
|
||||||
|
if (!empty($mode)) {
|
||||||
|
$param .= '&mode='.urlencode($mode);
|
||||||
|
}
|
||||||
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
$param .= '&contextpage='.urlencode($contextpage);
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
}
|
}
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||||
$param .= '&limit='.urlencode($limit);
|
$param .= '&limit='.urlencode($limit);
|
||||||
}
|
}
|
||||||
if ($sall) {
|
if ($sall) {
|
||||||
$param .= "&sall=".urlencode($sall);
|
$param .= "&sall=".urlencode($sall);
|
||||||
}
|
}
|
||||||
if ($search_ref) {
|
if ($search_ref) {
|
||||||
$param = "&search_ref=".urlencode($search_ref);
|
$param = "&search_ref=".urlencode($search_ref);
|
||||||
}
|
}
|
||||||
if ($search_label) {
|
if ($search_label) {
|
||||||
$param .= "&search_label=".urlencode($search_label);
|
$param .= "&search_label=".urlencode($search_label);
|
||||||
}
|
}
|
||||||
|
if ($optioncss != '') {
|
||||||
|
$param .= '&optioncss='.urlencode($optioncss);
|
||||||
|
}
|
||||||
|
// Add $param from extra fields
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
|
// Add $param from hooks
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
|
$param .= $hookmanager->resPrint;
|
||||||
|
|
||||||
// Add $param from extra fields
|
// List of mass actions available
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
$arrayofmassactions = array(
|
||||||
|
|
||||||
// List of mass actions available
|
|
||||||
$arrayofmassactions = array(
|
|
||||||
'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
|
'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
|
||||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
//'presend'=>$langs->trans("SendByMail"),
|
||||||
);
|
);
|
||||||
if ($user->rights->intracommreport->delete) {
|
if (!empty($permissiontodelete)) {
|
||||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
}
|
}
|
||||||
if (in_array($massaction, array('presend', 'predelete'))) {
|
if (in_array($massaction, array('presend', 'predelete'))) {
|
||||||
$arrayofmassactions = array();
|
$arrayofmassactions = array();
|
||||||
}
|
}
|
||||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||||
|
|
||||||
$newcardbutton = '';
|
$newcardbutton = '';
|
||||||
if ($user->rights->intracommreport->write) {
|
if ($user->rights->intracommreport->write) {
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans("NewDeclaration"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/intracommreport/card.php?action=create&type='.$type);
|
$newcardbutton .= dolGetButtonTitle($langs->trans("NewDeclaration"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/intracommreport/card.php?action=create&type='.$type);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">';
|
||||||
if ($optioncss != '') {
|
if ($optioncss != '') {
|
||||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
}
|
}
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="action" value="list">';
|
print '<input type="hidden" name="action" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||||
if (empty($arrayfields['i.fk_product_type']['checked'])) {
|
if (empty($arrayfields['i.fk_product_type']['checked'])) {
|
||||||
print '<input type="hidden" name="search_type" value="'.dol_escape_htmltag($search_type).'">';
|
print '<input type="hidden" name="search_type" value="'.dol_escape_htmltag($search_type).'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'intracommreport', 0, $newcardbutton, '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'intracommreport', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
$topicmail = "Information";
|
$topicmail = "Information";
|
||||||
$modelmail = "product";
|
$modelmail = "product";
|
||||||
$objecttmp = new IntracommReport($db);
|
$objecttmp = new IntracommReport($db);
|
||||||
$trackid = 'prod'.$object->id;
|
$trackid = 'prod'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||||
|
|
||||||
if ($sall) {
|
if ($sall) {
|
||||||
foreach ($fieldstosearchall as $key => $val) {
|
foreach ($fieldstosearchall as $key => $val) {
|
||||||
$fieldstosearchall[$key] = $langs->trans($val);
|
$fieldstosearchall[$key] = $langs->trans($val);
|
||||||
}
|
}
|
||||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall).join(', ', $fieldstosearchall).'</div>';
|
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall).join(', ', $fieldstosearchall).'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
$moreforfilter .= $hookmanager->resPrint;
|
$moreforfilter .= $hookmanager->resPrint;
|
||||||
} else {
|
} else {
|
||||||
$moreforfilter = $hookmanager->resPrint;
|
$moreforfilter = $hookmanager->resPrint;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($moreforfilter) {
|
if ($moreforfilter) {
|
||||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||||
print $moreforfilter;
|
print $moreforfilter;
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
if ($massactionbutton) {
|
if ($massactionbutton) {
|
||||||
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||||
|
|
||||||
// Lines with input filters
|
// Lines with input filters
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
if (!empty($arrayfields['i.ref']['checked'])) {
|
if (!empty($arrayfields['i.ref']['checked'])) {
|
||||||
print '<td class="liste_titre left">';
|
print '<td class="liste_titre left">';
|
||||||
print '<input class="flat" type="text" name="search_ref" size="8" value="'.dol_escape_htmltag($search_ref).'">';
|
print '<input class="flat" type="text" name="search_ref" size="8" value="'.dol_escape_htmltag($search_ref).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['i.label']['checked'])) {
|
if (!empty($arrayfields['i.label']['checked'])) {
|
||||||
print '<td class="liste_titre left">';
|
print '<td class="liste_titre left">';
|
||||||
print '<input class="flat" type="text" name="search_label" size="12" value="'.dol_escape_htmltag($search_label).'">';
|
print '<input class="flat" type="text" name="search_label" size="12" value="'.dol_escape_htmltag($search_label).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Type
|
// Type
|
||||||
// Type (customer/prospect/supplier)
|
// Type (customer/prospect/supplier)
|
||||||
if (!empty($arrayfields['customerorsupplier']['checked'])) {
|
if (!empty($arrayfields['customerorsupplier']['checked'])) {
|
||||||
print '<td class="liste_titre maxwidthonsmartphone center">';
|
print '<td class="liste_titre maxwidthonsmartphone center">';
|
||||||
if ($type != '') {
|
if ($type != '') {
|
||||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||||
}
|
}
|
||||||
print $formcompany->selectProspectCustomerType($search_type, 'search_type', 'search_type', 'list');
|
print $formcompany->selectProspectCustomerType($search_type, 'search_type', 'search_type', 'list');
|
||||||
print '</select></td>';
|
print '</select></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($arrayfields['i.fk_product_type']['checked'])) {
|
if (!empty($arrayfields['i.fk_product_type']['checked'])) {
|
||||||
print '<td class="liste_titre left">';
|
print '<td class="liste_titre left">';
|
||||||
$array = array('-1'=>' ', '0'=>$langs->trans('Product'), '1'=>$langs->trans('Service'));
|
$array = array('-1'=>' ', '0'=>$langs->trans('Product'), '1'=>$langs->trans('Service'));
|
||||||
print $form->selectarray('search_type', $array, $search_type);
|
print $form->selectarray('search_type', $array, $search_type);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||||
*/
|
*/
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters = array('arrayfields'=>$arrayfields);
|
$parameters = array('arrayfields'=>$arrayfields);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
// Date creation
|
// Date creation
|
||||||
if (!empty($arrayfields['i.datec']['checked'])) {
|
if (!empty($arrayfields['i.datec']['checked'])) {
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Date modification
|
// Date modification
|
||||||
if (!empty($arrayfields['i.tms']['checked'])) {
|
if (!empty($arrayfields['i.tms']['checked'])) {
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '<td class="liste_titre center maxwidthsearch">';
|
print '<td class="liste_titre center maxwidthsearch">';
|
||||||
$searchpicto = $form->showFilterButtons();
|
$searchpicto = $form->showFilterButtons();
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (!empty($arrayfields['i.ref']['checked'])) {
|
if (!empty($arrayfields['i.ref']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['i.ref']['label'], $_SERVER["PHP_SELF"], "i.ref", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['i.ref']['label'], $_SERVER["PHP_SELF"], "i.ref", "", $param, "", $sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['i.label']['checked'])) {
|
if (!empty($arrayfields['i.label']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['i.label']['label'], $_SERVER["PHP_SELF"], "i.label", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['i.label']['label'], $_SERVER["PHP_SELF"], "i.label", "", $param, "", $sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['i.fk_product_type']['checked'])) {
|
if (!empty($arrayfields['i.fk_product_type']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['i.fk_product_type']['label'], $_SERVER["PHP_SELF"], "i.fk_product_type", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['i.fk_product_type']['label'], $_SERVER["PHP_SELF"], "i.fk_product_type", "", $param, "", $sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||||
*/
|
*/
|
||||||
// Hook fields
|
// Hook fields
|
||||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (!empty($arrayfields['i.datec']['checked'])) {
|
if (!empty($arrayfields['i.datec']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['i.datec']['label'], $_SERVER["PHP_SELF"], "i.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
print_liste_field_titre($arrayfields['i.datec']['label'], $_SERVER["PHP_SELF"], "i.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['i.tms']['checked'])) {
|
if (!empty($arrayfields['i.tms']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['i.tms']['label'], $_SERVER["PHP_SELF"], "i.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
print_liste_field_titre($arrayfields['i.tms']['label'], $_SERVER["PHP_SELF"], "i.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||||
}
|
}
|
||||||
|
|
||||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|
||||||
$intracommreport_static = new IntracommReport($db);
|
$intracommreport_static = new IntracommReport($db);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$totalarray = array();
|
$totalarray = array();
|
||||||
while ($i < min($num, $limit)) {
|
while ($i < min($num, $limit)) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$intracommreport_static->id = $obj->rowid;
|
$intracommreport_static->id = $obj->rowid;
|
||||||
@ -543,17 +558,25 @@ if ($resql) {
|
|||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
|
||||||
|
|
||||||
$db->free($resql);
|
|
||||||
|
|
||||||
print "</table>";
|
|
||||||
print "</div>";
|
|
||||||
print '</form>';
|
|
||||||
} else {
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If no record found
|
||||||
|
if ($num == 0) {
|
||||||
|
$colspan = 1;
|
||||||
|
foreach ($arrayfields as $key => $val) {
|
||||||
|
if (!empty($val['checked'])) {
|
||||||
|
$colspan++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->free($resql);
|
||||||
|
|
||||||
|
print "</table>";
|
||||||
|
print "</div>";
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user