Fix phpcs
This commit is contained in:
parent
3ec2338c2d
commit
58e2901d14
@ -100,7 +100,7 @@ if ($action == 'edit')
|
|||||||
foreach($arrayofparameters as $key => $val)
|
foreach($arrayofparameters as $key => $val)
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip'));
|
print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip'));
|
||||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css'])?'minwidth200':$val['css']).'" value="' . $conf->global->$key . '"></td></tr>';
|
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css'])?'minwidth200':$val['css']).'" value="' . $conf->global->$key . '"></td></tr>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -122,7 +122,7 @@ else
|
|||||||
foreach($arrayofparameters as $key => $val)
|
foreach($arrayofparameters as $key => $val)
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip'));
|
print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip'));
|
||||||
print '</td><td>' . $conf->global->$key . '</td></tr>';
|
print '</td><td>' . $conf->global->$key . '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -78,17 +78,17 @@ $backtopage = GETPOST('backtopage', 'alpha');
|
|||||||
$object=new BillOfMaterials($db);
|
$object=new BillOfMaterials($db);
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
||||||
$hookmanager->initHooks(array('bomcard','globalcard')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('bomcard', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
// Initialize array of search criterias
|
// Initialize array of search criterias
|
||||||
$search_all=trim(GETPOST("search_all",'alpha'));
|
$search_all=trim(GETPOST("search_all", 'alpha'));
|
||||||
$search=array();
|
$search=array();
|
||||||
foreach($object->fields as $key => $val)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha');
|
if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($action) && empty($id) && empty($ref)) $action='view';
|
if (empty($action) && empty($id) && empty($ref)) $action='view';
|
||||||
@ -119,7 +119,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
$permissiontoadd = $user->rights->bom->write;
|
$permissiontoadd = $user->rights->bom->write;
|
||||||
$permissiontodelete = $user->rights->bom->delete || ($permissiontoadd && $object->status == 0);
|
$permissiontodelete = $user->rights->bom->delete || ($permissiontoadd && $object->status == 0);
|
||||||
$backurlforlist = dol_buildpath('/bom/bom_list.php',1);
|
$backurlforlist = dol_buildpath('/bom/bom_list.php', 1);
|
||||||
if (empty($backtopage)) {
|
if (empty($backtopage)) {
|
||||||
if (empty($id)) $backtopage = $backurlforlist;
|
if (empty($id)) $backtopage = $backurlforlist;
|
||||||
else $backtopage = dol_buildpath('/bom/bom_card.php',1).($id > 0 ? $id : '__ID__');
|
else $backtopage = dol_buildpath('/bom/bom_card.php',1).($id > 0 ? $id : '__ID__');
|
||||||
@ -360,7 +360,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
if ($action != 'presend' && $action != 'editline') {
|
if ($action != 'presend' && $action != 'editline') {
|
||||||
print '<div class="tabsAction">'."\n";
|
print '<div class="tabsAction">'."\n";
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
|
|||||||
@ -74,7 +74,7 @@ if (! $sortfield) $sortfield="name";
|
|||||||
$object=new BillOfMaterials($db);
|
$object=new BillOfMaterials($db);
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
||||||
$hookmanager->initHooks(array('bomdocument','globalcard')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('bomdocument', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label('bom');
|
$extralabels = $extrafields->fetch_name_optionals_label('bom');
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ if ($object->id)
|
|||||||
|
|
||||||
|
|
||||||
// Build file list
|
// Build file list
|
||||||
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
$filearray=dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC), 1);
|
||||||
$totalsize=0;
|
$totalsize=0;
|
||||||
foreach($filearray as $key => $file)
|
foreach($filearray as $key => $file)
|
||||||
{
|
{
|
||||||
@ -158,7 +158,7 @@ if ($object->id)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
accessforbidden('',0,0);
|
accessforbidden('', 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -62,26 +62,26 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
|||||||
dol_include_once('/bom/class/bom.class.php');
|
dol_include_once('/bom/class/bom.class.php');
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("bom@bom","other"));
|
$langs->loadLangs(array("bom@bom", "other"));
|
||||||
|
|
||||||
$action = GETPOST('action','aZ09')?GETPOST('action','aZ09'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
|
$action = GETPOST('action', 'aZ09')?GETPOST('action', 'aZ09'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
|
||||||
$massaction = GETPOST('massaction','alpha'); // The bulk action (combo box choice into lists)
|
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
|
||||||
$show_files = GETPOST('show_files','int'); // Show files area generated by bulk actions ?
|
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
|
||||||
$confirm = GETPOST('confirm','alpha'); // Result of a confirmation
|
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
|
||||||
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
|
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
|
||||||
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
|
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
|
||||||
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'bomlist'; // To manage different context of search
|
$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'bomlist'; // To manage different context of search
|
||||||
$backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated page
|
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||||
$optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print')
|
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||||
|
|
||||||
$id = GETPOST('id','int');
|
$id = GETPOST('id','int');
|
||||||
|
|
||||||
// Load variable for pagination
|
// Load variable for pagination
|
||||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield','alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder','alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page','int');
|
$page = GETPOST('page', 'int');
|
||||||
if (empty($page) || $page == -1 || GETPOST('button_search','alpha') || GETPOST('button_removefilter','alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
@ -95,7 +95,7 @@ $diroutputmassaction = $conf->bom->dir_output . '/temp/massgeneration/'.$user->i
|
|||||||
$hookmanager->initHooks(array('bomlist')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('bomlist')); // Note that conf->hooks_modules contains array
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label('bom'); // Load $extrafields->attributes['bom']
|
$extralabels = $extrafields->fetch_name_optionals_label('bom'); // Load $extrafields->attributes['bom']
|
||||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
// Default sort order (if not yet defined by previous GETPOST)
|
// Default sort order (if not yet defined by previous GETPOST)
|
||||||
if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition.
|
if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition.
|
||||||
@ -111,11 +111,11 @@ if ($user->societe_id > 0) // Protection if external user
|
|||||||
//$result = restrictedArea($user, 'bom', $id, '');
|
//$result = restrictedArea($user, 'bom', $id, '');
|
||||||
|
|
||||||
// Initialize array of search criterias
|
// Initialize array of search criterias
|
||||||
$search_all=trim(GETPOST("search_all",'alpha'));
|
$search_all=trim(GETPOST("search_all", 'alpha'));
|
||||||
$search=array();
|
$search=array();
|
||||||
foreach($object->fields as $key => $val)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha');
|
if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha');
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of fields to search into when doing a "search in all"
|
// List of fields to search into when doing a "search in all"
|
||||||
@ -172,8 +172,8 @@ if (empty($reshook))
|
|||||||
$toselect='';
|
$toselect='';
|
||||||
$search_array_options=array();
|
$search_array_options=array();
|
||||||
}
|
}
|
||||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
|
||||||
|| GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha'))
|
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha'))
|
||||||
{
|
{
|
||||||
$massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation
|
$massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation
|
||||||
}
|
}
|
||||||
@ -333,7 +333,7 @@ $arrayofmassactions = array(
|
|||||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
if ($user->rights->bom->delete) $arrayofmassactions['predelete']=$langs->trans("Delete");
|
if ($user->rights->bom->delete) $arrayofmassactions['predelete']=$langs->trans("Delete");
|
||||||
if (GETPOST('nomassaction','int') || in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
if (GETPOST('nomassaction','int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions=array();
|
||||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||||
|
|
||||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
@ -447,7 +447,7 @@ $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sort
|
|||||||
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
// Action column
|
// Action column
|
||||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],'','','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n";
|
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n";
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
|
||||||
@ -483,7 +483,7 @@ while ($i < min($num, $limit))
|
|||||||
foreach($object->fields as $key => $val)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
$cssforfield='';
|
$cssforfield='';
|
||||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
elseif ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
elseif ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
|
|
||||||
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
||||||
@ -582,13 +582,13 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb
|
|||||||
|
|
||||||
// Show list of available documents
|
// Show list of available documents
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
||||||
$urlsource.=str_replace('&','&',$param);
|
$urlsource.=str_replace('&', '&', $param);
|
||||||
|
|
||||||
$filedir=$diroutputmassaction;
|
$filedir=$diroutputmassaction;
|
||||||
$genallowed=$user->rights->bom->read;
|
$genallowed=$user->rights->bom->read;
|
||||||
$delallowed=$user->rights->bom->create;
|
$delallowed=$user->rights->bom->create;
|
||||||
|
|
||||||
print $formfile->showdocuments('massfilesarea_bom','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'','','',null,$hidegeneratedfilelistifempty);
|
print $formfile->showdocuments('massfilesarea_bom', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -87,7 +87,7 @@ $form = new Form($db);
|
|||||||
|
|
||||||
//$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes';
|
//$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes';
|
||||||
$help_url='';
|
$help_url='';
|
||||||
llxHeader('',$langs->trans('BillOfMaterials'),$help_url);
|
llxHeader('', $langs->trans('BillOfMaterials'), $help_url);
|
||||||
|
|
||||||
if ($id > 0 || ! empty($ref))
|
if ($id > 0 || ! empty($ref))
|
||||||
{
|
{
|
||||||
@ -99,7 +99,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
// Object card
|
// Object card
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
$linkback = '<a href="' .dol_buildpath('/bom/bom_list.php',1) . '?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
$linkback = '<a href="' .dol_buildpath('/bom/bom_list.php', 1) . '?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||||
|
|
||||||
$morehtmlref='<div class="refidno">';
|
$morehtmlref='<div class="refidno">';
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -316,7 +316,7 @@ class BillOfMaterials extends CommonObject
|
|||||||
if ($key=='t.rowid') {
|
if ($key=='t.rowid') {
|
||||||
$sqlwhere[] = $key . '='. $value;
|
$sqlwhere[] = $key . '='. $value;
|
||||||
}
|
}
|
||||||
elseif (strpos($key,'date') !== false) {
|
elseif (strpos($key, 'date') !== false) {
|
||||||
$sqlwhere[] = $key.' = \''.$this->db->idate($value).'\'';
|
$sqlwhere[] = $key.' = \''.$this->db->idate($value).'\'';
|
||||||
}
|
}
|
||||||
elseif ($key=='customsql') {
|
elseif ($key=='customsql') {
|
||||||
@ -412,13 +412,13 @@ class BillOfMaterials extends CommonObject
|
|||||||
$label.= '<br>';
|
$label.= '<br>';
|
||||||
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
|
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
|
||||||
|
|
||||||
$url = dol_buildpath('/bom/bom_card.php',1).'?id='.$this->id;
|
$url = dol_buildpath('/bom/bom_card.php', 1).'?id='.$this->id;
|
||||||
|
|
||||||
if ($option != 'nolink')
|
if ($option != 'nolink')
|
||||||
{
|
{
|
||||||
// Add param to save lastsearch_values or not
|
// Add param to save lastsearch_values or not
|
||||||
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
||||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
|
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
|
||||||
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
|
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -455,7 +455,7 @@ class BillOfMaterials extends CommonObject
|
|||||||
global $action,$hookmanager;
|
global $action,$hookmanager;
|
||||||
$hookmanager->initHooks(array('bomdao'));
|
$hookmanager->initHooks(array('bomdao'));
|
||||||
$parameters=array('id'=>$this->id, 'getnomurl'=>$result);
|
$parameters=array('id'=>$this->id, 'getnomurl'=>$result);
|
||||||
$reshook=$hookmanager->executeHooks('getNomUrl',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook > 0) $result = $hookmanager->resPrint;
|
if ($reshook > 0) $result = $hookmanager->resPrint;
|
||||||
else $result .= $hookmanager->resPrint;
|
else $result .= $hookmanager->resPrint;
|
||||||
|
|
||||||
@ -899,7 +899,7 @@ class BillOfMaterialsLine extends CommonObject
|
|||||||
if ($key=='t.rowid') {
|
if ($key=='t.rowid') {
|
||||||
$sqlwhere[] = $key . '='. $value;
|
$sqlwhere[] = $key . '='. $value;
|
||||||
}
|
}
|
||||||
elseif (strpos($key,'date') !== false) {
|
elseif (strpos($key, 'date') !== false) {
|
||||||
$sqlwhere[] = $key.' = \''.$this->db->idate($value).'\'';
|
$sqlwhere[] = $key.' = \''.$this->db->idate($value).'\'';
|
||||||
}
|
}
|
||||||
elseif ($key=='customsql') {
|
elseif ($key=='customsql') {
|
||||||
@ -1001,7 +1001,7 @@ class BillOfMaterialsLine extends CommonObject
|
|||||||
{
|
{
|
||||||
// Add param to save lastsearch_values or not
|
// Add param to save lastsearch_values or not
|
||||||
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
||||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
|
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
|
||||||
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
|
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1038,7 +1038,7 @@ class BillOfMaterialsLine extends CommonObject
|
|||||||
global $action,$hookmanager;
|
global $action,$hookmanager;
|
||||||
$hookmanager->initHooks(array('bomlinedao'));
|
$hookmanager->initHooks(array('bomlinedao'));
|
||||||
$parameters=array('id'=>$this->id, 'getnomurl'=>$result);
|
$parameters=array('id'=>$this->id, 'getnomurl'=>$result);
|
||||||
$reshook=$hookmanager->executeHooks('getNomUrl',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook > 0) $result = $hookmanager->resPrint;
|
if ($reshook > 0) $result = $hookmanager->resPrint;
|
||||||
else $result .= $hookmanager->resPrint;
|
else $result .= $hookmanager->resPrint;
|
||||||
|
|
||||||
|
|||||||
@ -97,7 +97,7 @@ function bomPrepareHead($object)
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||||
$upload_dir = $conf->bom->dir_output . "/bom/" . dol_sanitizeFileName($object->ref);
|
$upload_dir = $conf->bom->dir_output . "/bom/" . dol_sanitizeFileName($object->ref);
|
||||||
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
|
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
||||||
$nbLinks=Link::count($db, $object->element, $object->id);
|
$nbLinks=Link::count($db, $object->element, $object->id);
|
||||||
$head[$h][0] = dol_buildpath("/bom/bom_document.php", 1).'?id='.$object->id;
|
$head[$h][0] = dol_buildpath("/bom/bom_document.php", 1).'?id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans('Documents');
|
$head[$h][1] = $langs->trans('Documents');
|
||||||
@ -117,9 +117,8 @@ function bomPrepareHead($object)
|
|||||||
//); // to add new tab
|
//); // to add new tab
|
||||||
//$this->tabs = array(
|
//$this->tabs = array(
|
||||||
// 'entity:-tabname:Title:@bom:/bom/mypage.php?id=__ID__'
|
// 'entity:-tabname:Title:@bom:/bom/mypage.php?id=__ID__'
|
||||||
//); // to remove a tab
|
//); // to remove a tab
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom@bom');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom@bom');
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -59,7 +59,7 @@ class modBom extends DolibarrModules
|
|||||||
//$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
|
//$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
|
||||||
|
|
||||||
// Module label (no space allowed), used if translation string 'ModuleBomName' not found (Bom is name of module).
|
// Module label (no space allowed), used if translation string 'ModuleBomName' not found (Bom is name of module).
|
||||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
// Module description, used if translation string 'ModuleBomDesc' not found (Bom is name of module).
|
// Module description, used if translation string 'ModuleBomDesc' not found (Bom is name of module).
|
||||||
$this->description = "Bill of Materials (BOM) definitions for Manufacturing Resource Planning";
|
$this->description = "Bill of Materials (BOM) definitions for Manufacturing Resource Planning";
|
||||||
// Used only if file README.md and README-LL.md not found.
|
// Used only if file README.md and README-LL.md not found.
|
||||||
|
|||||||
@ -219,44 +219,46 @@ Class DataPolicy
|
|||||||
*/
|
*/
|
||||||
function sendMailDataPolicyCompany($societe)
|
function sendMailDataPolicyCompany($societe)
|
||||||
{
|
{
|
||||||
global $langs, $conf, $db, $user;
|
global $langs, $conf, $db, $user;
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$from = $user->getFullName($langs) . ' <' . $user->email . '>';
|
$from = $user->getFullName($langs) . ' <' . $user->email . '>';
|
||||||
|
|
||||||
$sendto = $societe->email;
|
$sendto = $societe->email;
|
||||||
|
|
||||||
$code= md5($societe->email);
|
$code= md5($societe->email);
|
||||||
if (!empty($societe->default_lang)) {
|
if (!empty($societe->default_lang)) {
|
||||||
$l = $societe->default_lang;
|
$l = $societe->default_lang;
|
||||||
} else {
|
} else {
|
||||||
$l = $langs->defaultlang;
|
$l = $langs->defaultlang;
|
||||||
}
|
}
|
||||||
$s = "DATAPOLICIESSUBJECT_" . $l;
|
$s = "DATAPOLICIESSUBJECT_" . $l;
|
||||||
$ma = "DATAPOLICIESCONTENT_" . $l;
|
$ma = "DATAPOLICIESCONTENT_" . $l;
|
||||||
$la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
|
$la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
|
||||||
$lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
|
$lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
|
||||||
|
|
||||||
$subject = $conf->global->$s;
|
$subject = $conf->global->$s;
|
||||||
$message = $conf->global->$ma;
|
$message = $conf->global->$ma;
|
||||||
$linka = $conf->global->$la;
|
$linka = $conf->global->$la;
|
||||||
$linkr = $conf->global->$lr;
|
$linkr = $conf->global->$lr;
|
||||||
$sendtocc = $sendtobcc = '';
|
$sendtocc = $sendtobcc = '';
|
||||||
$filepath = $mimetype = $filename = array();
|
$filepath = $mimetype = $filename = array();
|
||||||
$deliveryreceipt = 0;
|
$deliveryreceipt = 0;
|
||||||
|
|
||||||
$substitutionarray = array(
|
$substitutionarray = array(
|
||||||
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linka.'</a>',
|
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linka.'</a>',
|
||||||
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linkr.'</a>',
|
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linkr.'</a>',
|
||||||
);
|
);
|
||||||
$subject = make_substitutions($subject, $substitutionarray);
|
$subject = make_substitutions($subject, $substitutionarray);
|
||||||
$message = make_substitutions($message, $substitutionarray);
|
$message = make_substitutions($message, $substitutionarray);
|
||||||
|
|
||||||
$actiontypecode = 'AC_EMAIL';
|
$actiontypecode = 'AC_EMAIL';
|
||||||
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
|
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
|
||||||
if ($message) {
|
if ($message)
|
||||||
if ($sendtocc) {
|
{
|
||||||
|
if ($sendtocc)
|
||||||
|
{
|
||||||
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||||
}
|
}
|
||||||
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||||
@ -264,12 +266,12 @@ Class DataPolicy
|
|||||||
$actionmsg .= dol_concatdesc($actionmsg, $message);
|
$actionmsg .= dol_concatdesc($actionmsg, $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send mail
|
// Send mail
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
|
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
|
||||||
if ($mailfile->error) {
|
if ($mailfile->error) {
|
||||||
$resultmasssend .= '<div class="error">' . $mailfile->error . '</div>';
|
$resultmasssend .= '<div class="error">' . $mailfile->error . '</div>';
|
||||||
} else {
|
} else {
|
||||||
$result4 = $mailfile->sendfile();
|
$result4 = $mailfile->sendfile();
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
@ -279,8 +281,8 @@ Class DataPolicy
|
|||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setEventMessage($resultmasssend);
|
setEventMessage($resultmasssend);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -82,7 +82,7 @@ $search_array_options=$extrafields->getOptionalsFromPost($object->table_element,
|
|||||||
if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition.
|
if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition.
|
||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
|
|
||||||
if (GETPOST('search_fk_status','alpha') == 'non_closed') $_GET['search_fk_statut'][]='openall'; // For backward compatibility
|
if (GETPOST('search_fk_status', 'alpha') == 'non_closed') $_GET['search_fk_statut'][]='openall'; // For backward compatibility
|
||||||
|
|
||||||
// Initialize array of search criterias
|
// Initialize array of search criterias
|
||||||
$search_all=trim(GETPOST("search_all", 'alpha'));
|
$search_all=trim(GETPOST("search_all", 'alpha'));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user