Fix look and feel v6

This commit is contained in:
Laurent Destailleur 2017-06-14 11:28:42 +02:00
parent 00bf4bba13
commit 1b56e4a01c
13 changed files with 241 additions and 242 deletions

View File

@ -161,7 +161,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
}
}
$object = new Propal($db); // To be passed as parameter of executeHooks that need
$object = new Propal($db); // To be passed as parameter of executeHooks that need
/*
@ -359,12 +359,12 @@ if ($resql)
else
{
$title = $langs->trans('ListOfProposals');
}
}
$num = $db->num_rows($resql);
$arrayofselected=is_array($toselect)?$toselect:array();
$param='&viewstatut='.$viewstatut;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
@ -389,7 +389,7 @@ if ($resql)
$tmpkey=preg_replace('/search_options_/','',$key);
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
}
// List of mass actions available
$arrayofmassactions = array(
'presend'=>$langs->trans("SendByMail"),
@ -398,7 +398,7 @@ if ($resql)
if ($user->rights->propal->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
if ($massaction == 'presend') $arrayofmassactions=array();
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
// Lignes des champs de filtre
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
@ -408,13 +408,13 @@ if ($resql)
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit);
if ($massaction == 'presend')
{
$langs->load("mails");
if (! GETPOST('cancel'))
{
$objecttmp=new Propal($db);
@ -433,17 +433,17 @@ if ($resql)
}
}
}
print '<input type="hidden" name="massaction" value="confirm_presend">';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
dol_fiche_head(null, '', '');
$topicmail="SendSupplierProposalRef";
$modelmail="supplier_proposal_send";
// Cree l'objet formulaire mail
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
@ -496,25 +496,25 @@ if ($resql)
$formmail->substit['__REFCLIENT__']='__REFCLIENT__'; // We want to keep the tag
$formmail->substit['__PERSONALIZED__']='';
$formmail->substit['__CONTACTCIVNAME__']='';
// Tableau des parametres complementaires du post
$formmail->param['action']=$action;
$formmail->param['models']=$modelmail;
$formmail->param['models_id']=GETPOST('modelmailselected','int');
$formmail->param['id']=join(',',$arrayofselected);
//$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
print $formmail->get_form();
dol_fiche_end();
}
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
}
$i = 0;
$moreforfilter='';
@ -525,7 +525,7 @@ if ($resql)
$langs->load("commercial");
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
$moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth300');
$moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth200');
$moreforfilter.='</div>';
}
// If the user can view prospects other than his'
@ -533,7 +533,7 @@ if ($resql)
{
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': ';
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter.='</div>';
}
// If the user can view products
@ -550,7 +550,7 @@ if ($resql)
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
else $moreforfilter = $hookmanager->resPrint;
if (! empty($moreforfilter))
{
print '<div class="liste_titre liste_titre_bydiv centpercent">';
@ -561,12 +561,12 @@ if ($resql)
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
print '<tr class="liste_titre_filter">';
if (! empty($arrayfields['p.ref']['checked']))
if (! empty($arrayfields['p.ref']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
@ -608,7 +608,7 @@ if ($resql)
print '</td>';
}
// Date
if (! empty($arrayfields['p.date']['checked']))
if (! empty($arrayfields['p.date']['checked']))
{
print '<td class="liste_titre" colspan="1" align="center">';
//print $langs->trans('Month').': ';
@ -620,7 +620,7 @@ if ($resql)
print '</td>';
}
// Date end
if (! empty($arrayfields['p.fin_validite']['checked']))
if (! empty($arrayfields['p.fin_validite']['checked']))
{
print '<td class="liste_titre" colspan="1">&nbsp;</td>';
}
@ -703,10 +703,10 @@ if ($resql)
$searchpicto=$form->showFilterButtons();
print $searchpicto;
print '</td>';
print "</tr>\n";
// Fields title
print '<tr class="liste_titre">';
if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'],$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder);
@ -726,9 +726,9 @@ if ($resql)
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key => $val)
foreach($extrafields->attribute_label as $key => $val)
{
if (! empty($arrayfields["ef.".$key]['checked']))
if (! empty($arrayfields["ef.".$key]['checked']))
{
$align=$extrafields->getAlignFlag($key);
print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
@ -744,24 +744,24 @@ if ($resql)
if (! empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'],$_SERVER["PHP_SELF"],"p.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
print '</tr>'."\n";
$now = dol_now();
$i=0;
$totalarray=array();
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);
$objectstatic->id=$obj->rowid;
$objectstatic->ref=$obj->ref;
print '<tr class="oddeven">';
if (! empty($arrayfields['p.ref']['checked']))
{
print '<td class="nowrap">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
// Picto + Ref
print '<td class="nobordernopadding nowrap">';
@ -790,11 +790,11 @@ if ($resql)
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
print '</td></tr></table>';
print "</td>\n";
if (! $i) $totalarray['nbfield']++;
}
if (! empty($arrayfields['p.ref_client']['checked']))
{
// Customer ref
@ -803,12 +803,12 @@ if ($resql)
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
$companystatic->id=$obj->socid;
$companystatic->name=$obj->name;
$companystatic->client=$obj->client;
$companystatic->code_client=$obj->code_client;
// Thirdparty
if (! empty($arrayfields['s.nom']['checked']))
{
@ -817,7 +817,7 @@ if ($resql)
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Town
if (! empty($arrayfields['s.town']['checked']))
{
@ -858,7 +858,7 @@ if ($resql)
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Date proposal
if (! empty($arrayfields['p.date']['checked']))
{
@ -867,7 +867,7 @@ if ($resql)
print "</td>\n";
if (! $i) $totalarray['nbfield']++;
}
// Date end validity
if (! empty($arrayfields['p.fin_validite']['checked']))
{
@ -882,7 +882,7 @@ if ($resql)
}
if (! $i) $totalarray['nbfield']++;
}
// Amount HT
if (! empty($arrayfields['p.total_ht']['checked']))
{
@ -907,7 +907,7 @@ if ($resql)
if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
$totalarray['totalttc'] += $obj->total_ttc;
}
$userstatic->id=$obj->fk_user_author;
$userstatic->login=$obj->login;
@ -920,7 +920,7 @@ if ($resql)
print "</td>\n";
if (! $i) $totalarray['nbfield']++;
}
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
@ -1008,16 +1008,16 @@ if ($resql)
}
$db->free($resql);
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</table>'."\n";
print '</div>'."\n";
print '</form>'."\n";
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
{
/*
@ -1025,18 +1025,18 @@ if ($resql)
*/
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
$urlsource.=str_replace('&amp;','&',$param);
$filedir=$diroutputmassaction;
$genallowed=$user->rights->propal->lire;
$delallowed=$user->rights->propal->lire;
print $formfile->showdocuments('massfilesarea_proposals','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'','');
}
else
{
print '<br><a name="show_files"></a><a href="'.$_SERVER["PHP_SELF"].'?show_files=1'.$param.'#show_files">'.$langs->trans("ShowTempMassFilesArea").'</a>';
}
}
else
{

View File

@ -803,7 +803,7 @@ if ($resql)
$langs->load("commercial");
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
$moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth300');
$moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth200');
$moreforfilter.='</div>';
}
// If the user can view other users
@ -811,7 +811,7 @@ if ($resql)
{
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': ';
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter.='</div>';
}
// If the user can view prospects other than his'
@ -821,7 +821,7 @@ if ($resql)
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
$moreforfilter.='</div>';
}
$parameters=array();

View File

@ -191,7 +191,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOST("button_removefilter.x")) // Both test are required to be compatible with all browsers
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOST("button_removefilter.x")) // All tests are required to be compatible with all browsers
{
$search_user='';
$search_sale='';
@ -717,7 +717,7 @@ if ($resql)
$langs->load("commercial");
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
$moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth300');
$moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth200');
$moreforfilter.='</div>';
}
// If the user can view prospects other than his'
@ -725,7 +725,7 @@ if ($resql)
{
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': ';
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter.='</div>';
}
// If the user can view prospects other than his'
@ -735,7 +735,7 @@ if ($resql)
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
$moreforfilter.='</div>';
}
$parameters=array();

View File

@ -305,7 +305,7 @@ if ($resql)
$i = 0;
$arrayofselected=is_array($toselect)?$toselect:array();
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
@ -323,7 +323,7 @@ if ($resql)
$tmpkey=preg_replace('/search_options_/','',$key);
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
}
// List of mass actions available
$arrayofmassactions = array(
//'presend'=>$langs->trans("SendByMail"),
@ -332,7 +332,7 @@ if ($resql)
if ($user->rights->contrat->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
if ($massaction == 'presend') $arrayofmassactions=array();
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -341,7 +341,7 @@ if ($resql)
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'title_commercial.png', 0, '', '', $limit);
if ($sall)
@ -349,16 +349,16 @@ if ($resql)
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
}
$moreforfilter='';
// If the user can view prospects other than his'
if ($user->rights->societe->client->voir || $socid)
{
$langs->load("commercial");
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
$moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user,0,1,'maxwidth300');
$moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user,0,1,'maxwidth200');
$moreforfilter.='</div>';
}
// If the user can view other users
@ -366,7 +366,7 @@ if ($resql)
{
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': ';
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter.='</div>';
}
// If the user can view categories of products
@ -376,15 +376,15 @@ if ($resql)
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
$moreforfilter.='</div>';
}
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
else $moreforfilter = $hookmanager->resPrint;
if (! empty($moreforfilter))
{
print '<div class="liste_titre liste_titre_bydiv centpercent">';
@ -395,7 +395,7 @@ if ($resql)
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
@ -514,7 +514,7 @@ if ($resql)
print $searchpicto;
print '</td>';
print "</tr>\n";
print '<tr class="liste_titre">';
if (! empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], "c.ref","","$param",'',$sortfield,$sortorder);
if (! empty($arrayfields['c.ref_customer']['checked'])) print_liste_field_titre($arrayfields['c.ref_customer']['label'], $_SERVER["PHP_SELF"], "c.ref_customer","","$param",'',$sortfield,$sortorder);
@ -530,9 +530,9 @@ if ($resql)
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key => $val)
foreach($extrafields->attribute_label as $key => $val)
{
if (! empty($arrayfields["ef.".$key]['checked']))
if (! empty($arrayfields["ef.".$key]['checked']))
{
$align=$extrafields->getAlignFlag($key);
print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
@ -558,12 +558,12 @@ if ($resql)
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);
$contracttmp->ref=$obj->ref;
$contracttmp->id=$obj->rowid;
$contracttmp->ref_customer=$obj->ref_customer;
$contracttmp->ref_supplier=$obj->ref_supplier;
print '<tr class="oddeven">';
if (! empty($arrayfields['c.ref']['checked']))
{
@ -578,15 +578,15 @@ if ($resql)
}
print '</td>';
}
if (! empty($arrayfields['c.ref_customer']['checked']))
if (! empty($arrayfields['c.ref_customer']['checked']))
{
print '<td>'.$obj->ref_customer.'</td>';
}
if (! empty($arrayfields['c.ref_supplier']['checked']))
if (! empty($arrayfields['c.ref_supplier']['checked']))
{
print '<td>'.$obj->ref_supplier.'</td>';
}
if (! empty($arrayfields['s.nom']['checked']))
if (! empty($arrayfields['s.nom']['checked']))
{
print '<td><a href="../comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
}
@ -629,7 +629,7 @@ if ($resql)
print $typenArray[$obj->typent_code];
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
}
if (! empty($arrayfields['sale_representative']['checked']))
{
// Sales representatives
@ -713,7 +713,7 @@ if ($resql)
if (! $i) $totalarray['nbfield']++;
}
// Status
if (! empty($arrayfields['status']['checked']))
if (! empty($arrayfields['status']['checked']))
{
print '<td align="center">'.($obj->nb_initial>0?$obj->nb_initial:'').'</td>';
print '<td align="center">'.($obj->nb_running>0?$obj->nb_running:'').'</td>';
@ -730,7 +730,7 @@ if ($resql)
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
print "</tr>\n";
$i++;
}
@ -738,7 +738,7 @@ if ($resql)
print '</table>';
print '</div>';
print '</form>';
}
else

View File

@ -309,10 +309,11 @@ class FormOther
* @param string $htmlname Name of combo list
* @param int $nocateg Show also an entry "Not categorized"
* @param int $showempty Add also an empty line
* @return string Html combo list code
* @param string $morecss More CSS
* @return string Html combo list code
* @see select_all_categories
*/
function select_categories($type,$selected=0,$htmlname='search_categ',$nocateg=0,$showempty=1)
function select_categories($type, $selected=0, $htmlname='search_categ', $nocateg=0, $showempty=1, $morecss='')
{
global $conf, $langs;
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
@ -328,18 +329,16 @@ class FormOther
$tab_categs = $static_categs->get_full_arbo($type);
$moreforfilter = '';
$nodatarole = '';
// Enhance with select2
if ($conf->use_javascript_ajax)
{
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$comboenhancement = ajax_combobox('select_categ_'.$htmlname);
$moreforfilter.=$comboenhancement;
$nodatarole=($comboenhancement?' data-role="none"':'');
}
// Print a select with each of them
$moreforfilter.='<select class="flat minwidth100" id="select_categ_'.$htmlname.'" name="'.$htmlname.'"'.$nodatarole.'>';
$moreforfilter.='<select class="flat minwidth100'.($morecss?' '.$morecss:'').'" id="select_categ_'.$htmlname.'" name="'.$htmlname.'">';
if ($showempty) $moreforfilter.='<option value="0">&nbsp;</option>'; // Should use -1 to say nothing
if (is_array($tab_categs))
@ -379,7 +378,6 @@ class FormOther
$langs->load('users');
$out = '';
$nodatarole = '';
// Enhance with select2
if ($conf->use_javascript_ajax)
{
@ -389,11 +387,10 @@ class FormOther
if ($comboenhancement)
{
$out.=$comboenhancement;
$nodatarole=($comboenhancement?' data-role="none"':'');
}
}
// Select each sales and print them in a select input
$out.='<select class="flat'.($morecss?' '.$morecss:'').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$nodatarole.'>';
$out.='<select class="flat'.($morecss?' '.$morecss:'').'" id="'.$htmlname.'" name="'.$htmlname.'">';
if ($showempty) $out.='<option value="0">&nbsp;</option>';
// Get list of users allowed to be viewed

View File

@ -166,8 +166,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
-- Accountancy - Supplier invoice
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1600__+MAX_llx_menu__, 'accountancy', 'supplier_bills', 6__+MAX_llx_menu__, '/fourn/facture/list.php?leftmenu=suppliers_bills', 'BillsSuppliers', 0, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1601__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/fourn/facture/card.php?action=create&amp;leftmenu=suppliers_bills', 'NewBill', 1, 'bills', '$user->rights->fournisseur->facture->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1602__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/fourn/facture/impayees.php?leftmenu=suppliers_bills', 'Unpaid', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1602__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/fourn/facture/list.php?leftmenu=suppliers_bills', 'List', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1603__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/fourn/facture/paiement.php?leftmenu=suppliers_bills', 'Payments', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1605__+MAX_llx_menu__, 'accountancy', '', 1603__+MAX_llx_menu__, '/fourn/facture/rapport.php?leftmenu=suppliers_bills', 'Reporting', 2, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__);
-- Accountancy - Customer invoice
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'accountancy', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__);
@ -275,9 +276,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2603__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/bankentries.php?leftmenu=bank', 'ListTransactions', 1, 'banks', '$user->rights->banque->lire', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2604__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/budget.php?leftmenu=bank', 'ListTransactionsByCategory', 1, 'banks', '$user->rights->banque->lire', '', 0, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2606__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/transfer.php?leftmenu=bank', 'BankTransfers', 1, 'banks', '$user->rights->banque->transfer', '', 0, 5, __ENTITY__);
-- Account - Categories
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 2650__+MAX_llx_menu__, 'accountancy', 'cat', 14__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&amp;type=5', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 2651__+MAX_llx_menu__, 'accountancy', '', 2650__+MAX_llx_menu__, '/categories/card.php?action=create&amp;type=5', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__);
-- Bank - Categories
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 2650__+MAX_llx_menu__, 'accountancy', 'cat', 14__+MAX_llx_menu__, '/categories/index.php?leftmenu=bank&amp;type=5', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 2651__+MAX_llx_menu__, 'accountancy', '', 2650__+MAX_llx_menu__, '/categories/card.php?leftmenu=bank&amp;action=create&amp;type=5', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__);
-- Project
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?leftmenu=projects', 'Projects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?leftmenu=projects&amp;action=create', 'NewProject', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);

View File

@ -300,6 +300,8 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
// We update newmenu for special dynamic menus
if ($conf->banque->enabled && $user->rights->banque->lire && $mainmenu == 'bank') // Entry for each bank account
{
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Required for to get Account::TYPE_CASH for example
$sql = "SELECT rowid, label, courant, rappro, courant";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql.= " WHERE entity = ".$conf->entity;

View File

@ -127,7 +127,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
/*
* Actions
* Actions
*/
if (GETPOST('cancel')) { $action='list'; $massaction=''; }
@ -320,7 +320,7 @@ if ($resql)
$title = $langs->trans("ListTripsAndExpenses");
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit);
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
@ -333,7 +333,7 @@ if ($resql)
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
else $moreforfilter = $hookmanager->resPrint;
if (! empty($moreforfilter))
{
print '<div class="liste_titre liste_titre_bydiv centpercent">';
@ -344,10 +344,10 @@ if ($resql)
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
// Filters
print '<tr class="liste_titre_filter">';
if (! empty($arrayfields['d.ref']['checked']))
@ -362,7 +362,7 @@ if ($resql)
if ($user->rights->expensereport->readall || $user->rights->expensereport->lire_tous)
{
print '<td class="liste_titre maxwidthonspartphone" align="left">';
print $form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print $form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
print '</td>';
} else {
print '<td class="liste_titre">&nbsp;</td>';
@ -452,7 +452,7 @@ if ($resql)
{
print '<td class="liste_titre">';
print '</td>';
}
}
// Status
if (! empty($arrayfields['d.fk_statut']['checked']))
{
@ -498,7 +498,7 @@ if ($resql)
if (! empty($arrayfields['d.tms']['checked'])) print_liste_field_titre($arrayfields['d.tms']['label'],$_SERVER["PHP_SELF"],"d.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['d.fk_statut']['checked'])) print_liste_field_titre($arrayfields['d.fk_statut']['label'],$_SERVER["PHP_SELF"],"d.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
print "</tr>\n";
print "</tr>\n";
$total_total_ht = 0;
$total_total_ttc = 0;
@ -527,8 +527,8 @@ if ($resql)
$expensereportstatic->date_approve=$db->jdate($obj->date_approve);
$expensereportstatic->note_private=$obj->note_private;
$expensereportstatic->note_public=$obj->note_public;
print '<tr class="oddeven">';
// Ref
if (! empty($arrayfields['d.ref']['checked'])) {
@ -615,7 +615,7 @@ if ($resql)
if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
$totalarray['totalttc'] += $obj->total_ttc;
}
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
@ -723,11 +723,11 @@ if ($resql)
// Show list of available documents
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
$urlsource.=str_replace('&amp;','&',$param);
$filedir=$diroutputmassaction;
$genallowed=$user->rights->expensereport->lire;
$delallowed=$user->rights->expensereport->lire;
print $formfile->showdocuments('massfilesarea_expensereport','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
else

View File

@ -218,7 +218,7 @@ if (empty($reshook))
$toselect='';
$search_project_ref='';
$search_array_options=array();
// Mass actions
$objectclass='Commande';
$objectlabel='Orders';
@ -235,54 +235,54 @@ if (empty($reshook))
$permtodelete = $user->rights->fournisseur->commande->supprimer;
$uploaddir = $conf->fournisseur->commande->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
// TODO Move this into mass action include
if ($massaction == 'confirm_createbills')
if ($massaction == 'confirm_createbills')
{
$orders = GETPOST('toselect');
$createbills_onebythird = GETPOST('createbills_onebythird', 'int');
$validate_invoices = GETPOST('valdate_invoices', 'int');
$TFact = array();
$TFactThird = array();
$nb_bills_created = 0;
$db->begin();
foreach($orders as $id_order) {
$cmd = new Commande($db);
if($cmd->fetch($id_order) <= 0) continue;
$object = new Facture($db);
if(!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $object = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order.
else {
$object->socid = $cmd->socid;
$object->type = Facture::TYPE_STANDARD;
$object->cond_reglement_id = $cmd->cond_reglement_id;
$object->mode_reglement_id = $cmd->mode_reglement_id;
$object->fk_project = $cmd->fk_project;
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
if (empty($datefacture))
{
$datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y"));
}
$object->date = $datefacture;
$object->origin = 'commande';
$object->origin_id = $id_order;
$res = $object->create($user);
if($res > 0) $nb_bills_created++;
}
if($object->id > 0) {
$db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
$sql.= "fk_source";
@ -295,7 +295,7 @@ if (empty($reshook))
$sql.= ", ".$object->id;
$sql.= ", '".$object->element."'";
$sql.= ")";
if ($db->query($sql))
{
$db->commit();
@ -304,17 +304,17 @@ if (empty($reshook))
{
$db->rollback();
}
$lines = $cmd->lines;
if (empty($lines) && method_exists($cmd, 'fetch_lines'))
{
$cmd->fetch_lines();
$lines = $cmd->lines;
}
$fk_parent_line=0;
$num=count($lines);
for ($i=0;$i<$num;$i++)
{
$desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
@ -404,42 +404,42 @@ if (empty($reshook))
}
}
}
}
$cmd->classifyBilled($user);
if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $object;
else $TFact[$object->id] = $object;
}
// Build doc with all invoices
$TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird;
$toselect = array();
if(!empty($validate_invoices)) {
$massaction = $action = 'builddoc';
foreach($TAllFact as &$object) {
$object->validate($user);
$toselect[] = $object->id; // For builddoc action
// Fac builddoc
$upload_dir = $conf->facture->dir_output;
$permissioncreate=$user->rights->facture->creer;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
}
$objectclass='Facture';
$objectlabel='Invoice';
$permtoread = $user->rights->facture->lire;
$permtodelete = $user->rights->facture->supprimer;
$uploaddir = $conf->facture->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
if (! $error)
{
$db->commit();
@ -537,12 +537,11 @@ if ($billed != '' && $billed >= 0) $sql .= " AND cf.billed = ".$billed;
//Required triple check because statut=0 means draft filter
if (GETPOST('statut', 'alpha') !== '')
{
$sql .= " AND cf.fk_statut IN (".GETPOST('statut', 'alpha').")";
$sql .= " AND cf.fk_statut IN (".$db->escape(GETPOST('statut', 'alpha')).")";
}
if ($search_status != '' && $search_status >= 0)
{
if (strstr($search_status, ',')) $sql.=" AND cf.fk_statut IN (".$db->escape($search_status).")";
else $sql.=" AND cf.fk_statut = ".$search_status;
$sql.=" AND cf.fk_statut IN (".$db->escape($search_status).")";
}
if ($ordermonth > 0)
{
@ -573,11 +572,11 @@ else if ($deliveryyear > 0)
if ($search_town) $sql.= natural_search('s.town', $search_town);
if ($search_zip) $sql.= natural_search("s.zip",$search_zip);
if ($search_state) $sql.= natural_search("state.nom",$search_state);
if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')';
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')';
if ($search_country) $sql .= " AND s.fk_pays IN (".$db->escape($search_country).')';
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$db->escape($search_type_thirdparty).')';
if ($search_company) $sql .= natural_search('s.nom', $search_company);
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
if ($search_user > 0) $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='supplier_order' AND tc.source='internal' AND ec.element_id = cf.rowid AND ec.fk_socpeople = ".$search_user;
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$db->escape($search_sale);
if ($search_user > 0) $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='supplier_order' AND tc.source='internal' AND ec.element_id = cf.rowid AND ec.fk_socpeople = ".$db->escape($search_user);
if ($search_total_ht != '') $sql.= natural_search('cf.total_ht', $search_total_ht, 1);
if ($search_total_vat != '') $sql.= natural_search('cf.tva', $search_total_vat, 1);
if ($search_total_ttc != '') $sql.= natural_search('cf.total_ttc', $search_total_ttc, 1);
@ -629,7 +628,7 @@ if ($resql)
$num = $db->num_rows($resql);
$arrayofselected=is_array($toselect)?$toselect:array();
$param='';
if ($socid > 0) $param.='&socid='.$socid;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
@ -670,7 +669,7 @@ if ($resql)
if ($user->rights->fournisseur->commande->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
if ($massaction == 'presend' || $massaction == 'createbills') $arrayofmassactions=array();
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
// Lignes des champs de filtre
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
@ -688,7 +687,7 @@ if ($resql)
if ($massaction == 'presend')
{
$langs->load("mails");
if (! GETPOST('cancel'))
{
$objecttmp=new CommandeFournisseur($db);
@ -707,23 +706,23 @@ if ($resql)
}
}
}
print '<input type="hidden" name="massaction" value="confirm_presend">';
dol_fiche_head(null, '', '');
$topicmail="SendOrderRef";
$modelmail="order_send";
// Cree l'objet formulaire mail
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->withform=-1;
$formmail->fromtype = (GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user'));
if($formmail->fromtype === 'user'){
$formmail->fromid = $user->id;
}
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 1)) // If bit 1 is set
{
@ -767,23 +766,23 @@ if ($resql)
$formmail->substit['__REFCLIENT__']='__REFCLIENT__'; // We want to keep the tag
$formmail->substit['__PERSONALIZED__']='';
$formmail->substit['__CONTACTCIVNAME__']='';
// Tableau des parametres complementaires du post
$formmail->param['action']=$action;
$formmail->param['models']=$modelmail;
$formmail->param['models_id']=GETPOST('modelmailselected','int');
$formmail->param['id']=join(',',$arrayofselected);
//$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
print $formmail->get_form();
dol_fiche_end();
}
elseif ($massaction == 'createbills')
{
//var_dump($_REQUEST);
print '<input type="hidden" name="massaction" value="confirm_createbills">';
print '<table class="border" width="100%" >';
print '<tr>';
print '<td class="titlefieldmiddle">';
@ -810,7 +809,7 @@ if ($resql)
print '</td>';
print '</tr>';
print '</table>';
print '<br>';
print '<div class="center">';
print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('CreateInvoiceForThisCustomer').'"> ';
@ -818,7 +817,7 @@ if ($resql)
print '</div>';
print '<br>';
}
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
@ -833,7 +832,7 @@ if ($resql)
$langs->load("commercial");
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
$moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth300');
$moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth200');
$moreforfilter.='</div>';
}
// If the user can view other users
@ -841,7 +840,7 @@ if ($resql)
{
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': ';
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter.='</div>';
}
// If the user can view prospects other than his'
@ -851,14 +850,14 @@ if ($resql)
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
$moreforfilter.='</div>';
}
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
else $moreforfilter = $hookmanager->resPrint;
if (! empty($moreforfilter))
{
print '<div class="liste_titre liste_titre_bydiv centpercent">';
@ -1065,8 +1064,8 @@ if ($resql)
if (! empty($arrayfields['cf.billed']['checked'])) print_liste_field_titre($arrayfields['cf.billed']['label'],$_SERVER["PHP_SELF"],'cf.billed','',$param,'align="center"',$sortfield,$sortorder,'');
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
print "</tr>\n";
$total=0;
$subtotal=0;
$productstat_cache=array();
@ -1081,7 +1080,7 @@ if ($resql)
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);
$objectstatic->id=$obj->rowid;
$objectstatic->ref=$obj->ref;
@ -1098,7 +1097,7 @@ if ($resql)
if (! empty($arrayfields['cf.ref']['checked']))
{
print '<td class="nowrap">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
// Picto + Ref
print '<td class="nobordernopadding nowrap">';
@ -1113,7 +1112,7 @@ if ($resql)
$filedir=$conf->fournisseur->dir_output.'/commande' . '/' . dol_sanitizeFileName($obj->ref);
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
print '</td></tr></table>';
print '</td>'."\n";
if (! $i) $totalarray['nbfield']++;
}
@ -1319,18 +1318,18 @@ if ($resql)
*/
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
$urlsource.=str_replace('&amp;','&',$param);
$filedir=$diroutputmassaction;
$genallowed=$user->rights->fournisseur->commande->lire;
$delallowed=$user->rights->fournisseur->commande->lire;
print $formfile->showdocuments('massfilesarea_supplier_order','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
else
{
print '<br><a name="show_files"></a><a href="'.$_SERVER["PHP_SELF"].'?show_files=1'.$param.'#show_files">'.$langs->trans("ShowTempMassFilesArea").'</a>';
}
$db->free($resql);
}
else

View File

@ -193,7 +193,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
if (empty($reshook))
{
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOST("button_removefilter.x")) // All test must be present to be compatible with all browsers
{
$search_all="";
@ -232,7 +232,7 @@ if (empty($reshook))
$filter='';
$option='';
}
// Mass actions
$objectclass='FactureFournisseur';
$objectlabel='SupplierInvoices';
@ -242,7 +242,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
/*
* View
*/
@ -267,7 +267,7 @@ $sql.= " state.code_departement as state_code, state.nom as state_name,";
$sql.= " p.rowid as project_id, p.ref as project_ref";
// We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0)
// TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field.
if (! $search_all) $sql.= ', SUM(pf.amount) as dynamount_payed';
if (! $search_all) $sql.= ', SUM(pf.amount) as dynamount_payed';
// Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
// Add fields from hooks
@ -396,7 +396,7 @@ if (! $search_all)
foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by
{
$sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
}
}
}
else
{
@ -421,7 +421,7 @@ if ($resql)
$num = $db->num_rows($resql);
$arrayofselected=is_array($toselect)?$toselect:array();
if ($socid)
{
$soc = new Societe($db);
@ -460,7 +460,7 @@ if ($resql)
$tmpkey=preg_replace('/search_options_/','',$key);
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
}
// List of mass actions available
$arrayofmassactions = array(
//'presend'=>$langs->trans("SendByMail"),
@ -470,7 +470,7 @@ if ($resql)
if ($user->rights->fournisseur->facture->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
//if ($massaction == 'presend' || $massaction == 'createbills') $arrayofmassactions=array();
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
$i = 0;
print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
@ -484,11 +484,11 @@ if ($resql)
print '<input type="hidden" name="socid" value="'.$socid.'">';
print_barre_liste($langs->trans("BillsSuppliers").($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
if ($massaction == 'presend')
{
$langs->load("mails");
if (! GETPOST('cancel'))
{
$objecttmp=new FactureFourn($db);
@ -507,26 +507,26 @@ if ($resql)
}
}
}
print '<input type="hidden" name="massaction" value="confirm_presend">';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
dol_fiche_head(null, '', '');
$topicmail="SendBillRef";
$modelmail="supplier_invoice_send";
// Cree l'objet formulaire mail
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->withform=-1;
$formmail->fromtype = (GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user'));
if($formmail->fromtype === 'user'){
$formmail->fromid = $user->id;
}
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 1)) // If bit 1 is set
{
@ -570,23 +570,23 @@ if ($resql)
$formmail->substit['__REFCLIENT__']='__REFCLIENT__'; // We want to keep the tag
$formmail->substit['__PERSONALIZED__']='';
$formmail->substit['__CONTACTCIVNAME__']='';
// Tableau des parametres complementaires du post
$formmail->param['action']=$action;
$formmail->param['models']=$modelmail;
$formmail->param['models_id']=GETPOST('modelmailselected','int');
$formmail->param['id']=join(',',$arrayofselected);
//$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
print $formmail->get_form();
dol_fiche_end();
}
elseif ($massaction == 'createbills')
{
//var_dump($_REQUEST);
print '<input type="hidden" name="massaction" value="confirm_createbills">';
print '<table class="border" width="100%" >';
print '<tr>';
print '<td class="titlefieldmiddle">';
@ -613,7 +613,7 @@ if ($resql)
print '</td>';
print '</tr>';
print '</table>';
print '<br>';
print '<div class="center">';
print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('CreateInvoiceForThisCustomer').'"> ';
@ -621,13 +621,13 @@ if ($resql)
print '</div>';
print '<br>';
}
if ($search_all)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print $langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall);
}
// If the user can view prospects other than his'
$moreforfilter='';
if ($user->rights->societe->client->voir || $socid)
@ -635,7 +635,7 @@ if ($resql)
$langs->load("commercial");
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
$moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth300');
$moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth200');
$moreforfilter.='</div>';
}
// If the user can view prospects other than his'
@ -643,7 +643,7 @@ if ($resql)
{
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': ';
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter.='</div>';
}
// If the user can view prospects other than his'
@ -653,7 +653,7 @@ if ($resql)
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
$moreforfilter.='</div>';
}
$parameters=array();
@ -671,7 +671,7 @@ if ($resql)
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
@ -900,12 +900,12 @@ if ($resql)
if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'],$_SERVER["PHP_SELF"],"f.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'],$_SERVER["PHP_SELF"],"fk_statut,paye","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
print "</tr>\n";
print "</tr>\n";
$facturestatic=new FactureFournisseur($db);
$supplierstatic=new Fournisseur($db);
$projectstatic=new Project($db);
if ($num > 0)
{
$i=0;
@ -915,7 +915,7 @@ if ($resql)
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);
$datelimit=$db->jdate($obj->datelimite);
$facturestatic->id=$obj->facid;
$facturestatic->ref=$obj->ref;
@ -929,7 +929,7 @@ if ($resql)
$totaldeposits = $facturestatic->getSumDepositsUsed();
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
$remaintopay = $obj->total_ttc - $totalpay;
print '<tr class="oddeven">';
if (! empty($arrayfields['f.ref']['checked']))
{
@ -950,11 +950,11 @@ if ($resql)
$subdir = get_exdir($obj->facid,2,0,0,$facturestatic,'invoice_supplier').dol_sanitizeFileName($obj->ref);
print $formfile->getDocumentsLink('facture_fournisseur', $subdir, $filedir);
print '</td></tr></table>';
print "</td>\n";
if (! $i) $totalarray['nbfield']++;
}
// Customer ref
if (! empty($arrayfields['f.ref_supplier']['checked']))
{
@ -963,7 +963,7 @@ if ($resql)
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Label
if (! empty($arrayfields['f.label']['checked']))
{
@ -972,7 +972,7 @@ if ($resql)
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Date
if (! empty($arrayfields['f.datef']['checked']))
{
@ -981,7 +981,7 @@ if ($resql)
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Date limit
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
{
@ -993,7 +993,7 @@ if ($resql)
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Project
if (! empty($arrayfields['p.ref']['checked']))
{
@ -1007,7 +1007,7 @@ if ($resql)
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Third party
if (! empty($arrayfields['s.nom']['checked']))
{
@ -1061,7 +1061,7 @@ if ($resql)
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Payment mode
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
{
@ -1070,7 +1070,7 @@ if ($resql)
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Amount HT
if (! empty($arrayfields['f.total_ht']['checked']))
{
@ -1127,8 +1127,8 @@ if ($resql)
if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield'];
$totalarray['totalrtp'] += $remaintopay;
}
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
@ -1176,7 +1176,7 @@ if ($resql)
print "</td>";
if (! $i) $totalarray['nbfield']++;
}
// Action column
print '<td class="nowrap" align="center">';
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
@ -1187,12 +1187,12 @@ if ($resql)
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
print "</tr>\n";
$i++;
}
// Show total line
if (isset($totalarray['totalhtfield'])
|| isset($totalarray['totalvatfield'])
@ -1215,7 +1215,7 @@ if ($resql)
}
elseif ($totalarray['totalhtfield'] == $i) print '<td align="right">'.price($totalarray['totalht']).'</td>';
elseif ($totalarray['totalvatfield'] == $i) print '<td align="right">'.price($totalarray['totalvat']).'</td>';
elseif ($totalarray['totallocaltax1field'] == $i) print '<td align="right">'.price($totalarray['totallocaltax1']).'</td>';
elseif ($totalarray['totallocaltax1field'] == $i) print '<td align="right">'.price($totalarray['totallocaltax1']).'</td>';
elseif ($totalarray['totallocaltax2field'] == $i) print '<td align="right">'.price($totalarray['totallocaltax2']).'</td>';
elseif ($totalarray['totalttcfield'] == $i) print '<td align="right">'.price($totalarray['totalttc']).'</td>';
elseif ($totalarray['totalamfield'] == $i) print '<td align="right">'.price($totalarray['totalam']).'</td>';
@ -1223,32 +1223,32 @@ if ($resql)
else print '<td></td>';
}
print '</tr>';
}
}
$db->free($resql);
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print "</table>\n";
print '</div>';
print "</form>\n";
/*
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
{
// Show list of available documents
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
$urlsource.=str_replace('&amp;','&',$param);
$filedir=$diroutputmassaction;
$genallowed=$user->rights->facture->lire;
$delallowed=$user->rights->facture->lire;
print $formfile->showdocuments('massfilesarea_invoices','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
else

View File

@ -66,7 +66,7 @@ $year_end = GETPOST('year_end');
$search_employe = GETPOST('search_employe');
$search_valideur = GETPOST('search_valideur');
$search_statut = GETPOST('select_statut');
$type = GETPOST('type','int');
$type = GETPOST('type','int');
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array(
@ -310,14 +310,14 @@ print '</td>';
if ($user->rights->holiday->write_all)
{
print '<td class="liste_titre maxwidthonsmartphone" align="left">';
print $form->select_dolusers($search_employe,"search_employe",1,"",0,'','',0,32,0,'',0,'','maxwidth200');
print $form->select_dolusers($search_employe,"search_employe",1,"",0,'','',0,0,0,'',0,'','maxwidth200');
print '</td>';
}
else
{
//print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre maxwidthonsmartphone" align="left">';
print $form->select_dolusers($user->id,"search_employe",1,"",1,'','',0,32,0,'',0,'','maxwidth200');
print $form->select_dolusers($user->id,"search_employe",1,"",1,'','',0,0,0,'',0,'','maxwidth200');
print '</td>';
}
@ -331,7 +331,7 @@ if($user->rights->holiday->write_all)
$valideurobjects = $validator->listUsersForGroup($excludefilter);
$valideurarray = array();
foreach($valideurobjects as $val) $valideurarray[$val->id]=$val->id;
print $form->select_dolusers($search_valideur,"search_valideur",1,"",0,$valideurarray,'', 0, 32,0,'',0,'','maxwidth200');
print $form->select_dolusers($search_valideur,"search_valideur",1,"",0,$valideurarray,'', 0, 0, 0, '', 0, '', 'maxwidth200');
print '</td>';
}
else
@ -408,7 +408,7 @@ if (! empty($holiday->holiday))
$userstatic->login=$infos_CP['user_login'];
$userstatic->statut=$infos_CP['user_statut'];
$userstatic->photo=$infos_CP['user_photo'];
// Valideur
$approbatorstatic->id=$infos_CP['fk_validator'];
$approbatorstatic->lastname=$infos_CP['validator_lastname'];
@ -416,7 +416,7 @@ if (! empty($holiday->holiday))
$approbatorstatic->login=$infos_CP['validator_login'];
$approbatorstatic->statut=$infos_CP['validator_statut'];
$approbatorstatic->photo=$infos_CP['validator_photo'];
$date = $infos_CP['date_create'];
print '<tr class="oddeven">';

View File

@ -444,7 +444,7 @@ if (! empty($conf->categorie->enabled))
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('ProjectCategories'). ': ';
$moreforfilter.=$formother->select_categories('project',$search_categ,'search_categ',1);
$moreforfilter.=$formother->select_categories('project', $search_categ, 'search_categ', 1, 1, 'maxwidth300');
$moreforfilter.='</div>';
}
@ -453,7 +453,7 @@ $moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('ProjectsWithThisUserAsContact'). ': ';
$includeonly='';
if (empty($user->rights->user->user->lire)) $includeonly=array($user->id);
$moreforfilter.=$form->select_dolusers($search_project_user?$search_project_user:'', 'search_project_user', 1, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth300');
$moreforfilter.=$form->select_dolusers($search_project_user?$search_project_user:'', 'search_project_user', 1, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter.='</div>';
// If the user can view thirdparties other than his'
@ -462,7 +462,7 @@ if ($user->rights->societe->client->voir || $socid)
$langs->load("commercial");
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
$moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth300');
$moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth200');
$moreforfilter.='</div>';
}

View File

@ -442,7 +442,7 @@ if (! empty($conf->categorie->enabled))
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('ProjectCategories'). ': ';
$moreforfilter.=$formother->select_categories('project',$search_categ,'search_categ',1);
$moreforfilter.=$formother->select_categories('project', $search_categ, 'search_categ', 1, 'maxwidth300');
$moreforfilter.='</div>';
}
@ -451,7 +451,7 @@ $moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('ProjectsWithThisUserAsContact'). ' ';
$includeonly='';
if (empty($user->rights->user->user->lire)) $includeonly=array($user->id);
$moreforfilter.=$form->select_dolusers($search_project_user?$search_project_user:'', 'search_project_user', 1, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth300');
$moreforfilter.=$form->select_dolusers($search_project_user?$search_project_user:'', 'search_project_user', 1, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter.='</div>';
// If the user can view users
@ -459,7 +459,7 @@ $moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('TasksWithThisUserAsContact'). ': ';
$includeonly='';
if (empty($user->rights->user->user->lire)) $includeonly=array($user->id);
$moreforfilter.=$form->select_dolusers($search_task_user, 'search_task_user', 1, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth300');
$moreforfilter.=$form->select_dolusers($search_task_user, 'search_task_user', 1, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter.='</div>';
if (! empty($moreforfilter))