41 require
'../../main.inc.php';
42 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
43 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
44 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formpropal.class.php';
45 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
47 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmargin.class.php';
49 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
50 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
51 require_once DOL_DOCUMENT_ROOT.
'/comm/propal/class/propal.class.php';
52 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
54 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
55 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcategory.class.php';
59 $langs->loadLangs(array(
'companies',
'propal',
'compta',
'bills',
'orders',
'products',
'deliveries',
'categories'));
61 $langs->loadLangs(array(
'sendings'));
64 $socid =
GETPOST(
'socid',
'int');
66 $action =
GETPOST(
'action',
'aZ09');
67 $massaction =
GETPOST(
'massaction',
'alpha');
68 $show_files =
GETPOST(
'show_files',
'int');
69 $confirm =
GETPOST(
'confirm',
'alpha');
70 $toselect =
GETPOST(
'toselect',
'array');
71 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'proposallist';
73 $search_user =
GETPOST(
'search_user',
'int');
74 $search_sale =
GETPOST(
'search_sale',
'int');
76 $search_refcustomer =
GETPOST(
'search_refcustomer',
'alpha');
78 $search_refproject =
GETPOST(
'search_refproject',
'alpha');
79 $search_project =
GETPOST(
'search_project',
'alpha');
81 $search_societe =
GETPOST(
'search_societe',
'alpha');
82 $search_societe_alias =
GETPOST(
'search_societe_alias',
'alpha');
83 $search_montant_ht =
GETPOST(
'search_montant_ht',
'alpha');
84 $search_montant_vat =
GETPOST(
'search_montant_vat',
'alpha');
85 $search_montant_ttc =
GETPOST(
'search_montant_ttc',
'alpha');
86 $search_warehouse =
GETPOST(
'search_warehouse',
'alpha');
87 $search_multicurrency_code =
GETPOST(
'search_multicurrency_code',
'alpha');
88 $search_multicurrency_tx =
GETPOST(
'search_multicurrency_tx',
'alpha');
89 $search_multicurrency_montant_ht =
GETPOST(
'search_multicurrency_montant_ht',
'alpha');
90 $search_multicurrency_montant_vat =
GETPOST(
'search_multicurrency_montant_vat',
'alpha');
91 $search_multicurrency_montant_ttc =
GETPOST(
'search_multicurrency_montant_ttc',
'alpha');
92 $search_login =
GETPOST(
'search_login',
'alpha');
93 $search_product_category =
GETPOST(
'search_product_category',
'int');
94 $search_town =
GETPOST(
'search_town',
'alpha');
95 $search_zip =
GETPOST(
'search_zip',
'alpha');
96 $search_state =
GETPOST(
"search_state");
97 $search_country =
GETPOST(
"search_country",
'int');
98 $search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'int');
99 $search_date_startday =
GETPOST(
'search_date_startday',
'int');
100 $search_date_startmonth =
GETPOST(
'search_date_startmonth',
'int');
101 $search_date_startyear =
GETPOST(
'search_date_startyear',
'int');
102 $search_date_endday =
GETPOST(
'search_date_endday',
'int');
103 $search_date_endmonth =
GETPOST(
'search_date_endmonth',
'int');
104 $search_date_endyear =
GETPOST(
'search_date_endyear',
'int');
105 $search_date_start =
dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
106 $search_date_end =
dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
107 $search_date_end_startday =
GETPOST(
'search_date_end_startday',
'int');
108 $search_date_end_startmonth =
GETPOST(
'search_date_end_startmonth',
'int');
109 $search_date_end_startyear =
GETPOST(
'search_date_end_startyear',
'int');
110 $search_date_end_endday =
GETPOST(
'search_date_end_endday',
'int');
111 $search_date_end_endmonth =
GETPOST(
'search_date_end_endmonth',
'int');
112 $search_date_end_endyear =
GETPOST(
'search_date_end_endyear',
'int');
113 $search_date_end_start =
dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear);
114 $search_date_end_end =
dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);
115 $search_date_delivery_startday =
GETPOST(
'search_date_delivery_startday',
'int');
116 $search_date_delivery_startmonth =
GETPOST(
'search_date_delivery_startmonth',
'int');
117 $search_date_delivery_startyear =
GETPOST(
'search_date_delivery_startyear',
'int');
118 $search_date_delivery_endday =
GETPOST(
'search_date_delivery_endday',
'int');
119 $search_date_delivery_endmonth =
GETPOST(
'search_date_delivery_endmonth',
'int');
120 $search_date_delivery_endyear =
GETPOST(
'search_date_delivery_endyear',
'int');
121 $search_date_delivery_start =
dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear);
122 $search_date_delivery_end =
dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear);
123 $search_availability =
GETPOST(
'search_availability',
'int');
124 $search_categ_cus =
GETPOST(
"search_categ_cus",
'int');
125 $search_fk_cond_reglement =
GETPOST(
"search_fk_cond_reglement",
'int');
126 $search_fk_shipping_method =
GETPOST(
"search_fk_shipping_method",
'int');
127 $search_fk_input_reason =
GETPOST(
"search_fk_input_reason",
'int');
128 $search_fk_mode_reglement =
GETPOST(
"search_fk_mode_reglement",
'int');
129 $search_btn =
GETPOST(
'button_search',
'alpha');
130 $search_remove_btn =
GETPOST(
'button_removefilter',
'alpha');
131 $search_date_signature_startday =
GETPOST(
'search_date_signature_startday',
'int');
132 $search_date_signature_startmonth =
GETPOST(
'search_date_signature_startmonth',
'int');
133 $search_date_signature_startyear =
GETPOST(
'search_date_signature_startyear',
'int');
134 $search_date_signature_endday =
GETPOST(
'search_date_signature_endday',
'int');
135 $search_date_signature_endmonth =
GETPOST(
'search_date_signature_endmonth',
'int');
136 $search_date_signature_endyear =
GETPOST(
'search_date_signature_endyear',
'int');
137 $search_date_signature_start =
dol_mktime(0, 0, 0, $search_date_signature_startmonth, $search_date_signature_startday, $search_date_signature_startyear);
138 $search_date_signature_end =
dol_mktime(23, 59, 59, $search_date_signature_endmonth, $search_date_signature_endday, $search_date_signature_endyear);
141 $search_status =
GETPOST(
'search_status',
'alpha');
142 $optioncss =
GETPOST(
'optioncss',
'alpha');
143 $object_statut =
GETPOST(
'search_statut',
'alpha');
145 $sall = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
149 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
150 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
151 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
153 if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction ===
'0')) {
156 $offset = $limit * $page;
157 $pageprev = $page - 1;
158 $pagenext = $page + 1;
160 $sortfield =
'p.ref';
170 if (!empty($user->socid)) {
171 $socid = $user->socid;
173 if (!empty($socid)) {
176 $dbtable =
'&societe';
180 $diroutputmassaction = $conf->propal->multidir_output[$conf->entity].
'/temp/massgeneration/'.$user->id;
183 $object =
new Propal($db);
184 $hookmanager->initHooks(array(
'propallist'));
188 $extrafields->fetch_name_optionals_label($object->table_element);
190 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
193 $fieldstosearchall = array(
195 'p.ref_client'=>
'RefCustomer',
196 'pd.description'=>
'Description',
197 's.nom'=>
"ThirdParty",
198 's.name_alias'=>
"AliasNameShort",
201 'p.note_public'=>
'NotePublic',
203 if (empty($user->socid)) {
204 $fieldstosearchall[
"p.note_private"] =
"NotePrivate";
208 $checkedtypetiers = 0;
209 $arrayfields = array(
210 'p.ref'=>array(
'label'=>
"Ref",
'checked'=>1),
211 'p.ref_client'=>array(
'label'=>
"RefCustomer",
'checked'=>-1),
212 'pr.ref'=>array(
'label'=>
"ProjectRef",
'checked'=>1,
'enabled'=>(
isModEnabled(
'project') ? 1 : 0)),
213 'pr.title'=>array(
'label'=>
"ProjectLabel",
'checked'=>0,
'enabled'=>(
isModEnabled(
'project') ? 1 : 0)),
214 's.nom'=>array(
'label'=>
"ThirdParty",
'checked'=>1),
215 's.name_alias'=>array(
'label'=>
"AliasNameShort",
'checked'=>-1),
216 's.town'=>array(
'label'=>
"Town",
'checked'=>-1),
217 's.zip'=>array(
'label'=>
"Zip",
'checked'=>-1),
218 'state.nom'=>array(
'label'=>
"StateShort",
'checked'=>0),
219 'country.code_iso'=>array(
'label'=>
"Country",
'checked'=>0),
220 'typent.code'=>array(
'label'=>
"ThirdPartyType",
'checked'=>$checkedtypetiers),
221 'p.date'=>array(
'label'=>
"DatePropal",
'checked'=>1),
222 'p.fin_validite'=>array(
'label'=>
"DateEnd",
'checked'=>1),
223 'p.date_livraison'=>array(
'label'=>
"DeliveryDate",
'checked'=>0),
224 'p.date_signature'=>array(
'label'=>
"DateSigning",
'checked'=>0),
225 'ava.rowid'=>array(
'label'=>
"AvailabilityPeriod",
'checked'=>0),
226 'p.fk_shipping_method'=>array(
'label'=>
"SendingMethod",
'checked'=>0,
'enabled'=>
isModEnabled(
"expedition")),
227 'p.fk_input_reason'=>array(
'label'=>
"Origin",
'checked'=>0,
'enabled'=>1),
228 'p.fk_cond_reglement'=>array(
'label'=>
"PaymentConditionsShort",
'checked'=>0),
229 'p.fk_mode_reglement'=>array(
'label'=>
"PaymentMode",
'checked'=>0),
230 'p.total_ht'=>array(
'label'=>
"AmountHT",
'checked'=>1),
231 'p.total_tva'=>array(
'label'=>
"AmountVAT",
'checked'=>0),
232 'p.total_ttc'=>array(
'label'=>
"AmountTTC",
'checked'=>0),
233 'p.total_ht_invoiced'=>array(
'label'=>
"AmountInvoicedHT",
'checked'=>0,
'enabled'=>!empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
234 'p.total_invoiced'=>array(
'label'=>
"AmountInvoicedTTC",
'checked'=>0,
'enabled'=>!empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
235 'p.multicurrency_code'=>array(
'label'=>
'Currency',
'checked'=>0,
'enabled'=>(!
isModEnabled(
"multicurrency") ? 0 : 1)),
236 'p.multicurrency_tx'=>array(
'label'=>
'CurrencyRate',
'checked'=>0,
'enabled'=>(!
isModEnabled(
"multicurrency") ? 0 : 1)),
237 'p.multicurrency_total_ht'=>array(
'label'=>
'MulticurrencyAmountHT',
'checked'=>0,
'enabled'=>(!
isModEnabled(
"multicurrency") ? 0 : 1)),
238 'p.multicurrency_total_tva'=>array(
'label'=>
'MulticurrencyAmountVAT',
'checked'=>0,
'enabled'=>(!
isModEnabled(
"multicurrency") ? 0 : 1)),
239 'p.multicurrency_total_ttc'=>array(
'label'=>
'MulticurrencyAmountTTC',
'checked'=>0,
'enabled'=>(!
isModEnabled(
"multicurrency") ? 0 : 1)),
240 'p.multicurrency_total_ht_invoiced'=>array(
'label'=>
'MulticurrencyAmountInvoicedHT',
'checked'=>0,
'enabled'=>
isModEnabled(
"multicurrency") && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
241 'p.multicurrency_total_invoiced'=>array(
'label'=>
'MulticurrencyAmountInvoicedTTC',
'checked'=>0,
'enabled'=>
isModEnabled(
"multicurrency") && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
242 'u.login'=>array(
'label'=>
"Author",
'checked'=>1,
'position'=>10),
243 'sale_representative'=>array(
'label'=>
"SaleRepresentativesOfThirdParty",
'checked'=>-1),
244 'total_pa' => array(
'label' => (
getDolGlobalString(
'MARGIN_TYPE') ==
'1' ?
'BuyingPrice' :
'CostPrice'),
'checked' => 0,
'position' => 300,
'enabled' => (!
isModEnabled(
'margin') || !$user->rights->margins->liretous ? 0 : 1)),
245 'total_margin' => array(
'label' =>
'Margin',
'checked' => 0,
'position' => 301,
'enabled' => (!
isModEnabled(
'margin') || !$user->rights->margins->liretous ? 0 : 1)),
246 'total_margin_rate' => array(
'label' =>
'MarginRate',
'checked' => 0,
'position' => 302,
'enabled' => (!
isModEnabled(
'margin') || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)),
247 'total_mark_rate' => array(
'label' =>
'MarkRate',
'checked' => 0,
'position' => 303,
'enabled' => (!
isModEnabled(
'margin') || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)),
248 'p.datec'=>array(
'label'=>
"DateCreation",
'checked'=>0,
'position'=>500),
249 'p.tms'=>array(
'label'=>
"DateModificationShort",
'checked'=>0,
'position'=>500),
250 'p.date_cloture'=>array(
'label'=>
"DateClosing",
'checked'=>0,
'position'=>500),
251 'p.note_public'=>array(
'label'=>
'NotePublic',
'checked'=>0,
'position'=>510,
'enabled'=>(!
getDolGlobalInt(
'MAIN_LIST_HIDE_PUBLIC_NOTES'))),
252 'p.note_private'=>array(
'label'=>
'NotePrivate',
'checked'=>0,
'position'=>511,
'enabled'=>(!
getDolGlobalInt(
'MAIN_LIST_HIDE_PRIVATE_NOTES'))),
253 'p.fk_statut'=>array(
'label'=>
"Status",
'checked'=>1,
'position'=>1000),
279 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
281 $permissiontoread = $user->rights->propal->lire;
282 $permissiontoadd = $user->rights->propal->creer;
283 $permissiontodelete = $user->rights->propal->supprimer;
284 if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
285 $permissiontovalidate = $user->rights->propal->propal_advance->validate;
286 $permissiontoclose = $user->rights->propal->propal_advance->close;
287 $permissiontosendbymail = $user->rights->propal->propal_advance->send;
289 $permissiontovalidate = $user->rights->propal->creer;
290 $permissiontoclose = $user->rights->propal->creer;
291 $permissiontosendbymail = $user->rights->propal->lire;
299 if (
GETPOST(
'cancel',
'alpha')) {
303 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
307 $parameters = array(
'socid'=>$socid,
'arrayfields'=>&$arrayfields);
308 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
313 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
316 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
321 $search_refcustomer =
'';
322 $search_refproject =
'';
323 $search_project =
'';
324 $search_societe =
'';
325 $search_societe_alias =
'';
326 $search_montant_ht =
'';
327 $search_montant_vat =
'';
328 $search_montant_ttc =
'';
329 $search_warehouse =
'';
330 $search_multicurrency_code =
'';
331 $search_multicurrency_tx =
'';
332 $search_multicurrency_montant_ht =
'';
333 $search_multicurrency_montant_vat =
'';
334 $search_multicurrency_montant_ttc =
'';
336 $search_product_category =
'';
341 $search_country =
'';
342 $search_type_thirdparty =
'';
343 $search_date_startday =
'';
344 $search_date_startmonth =
'';
345 $search_date_startyear =
'';
346 $search_date_endday =
'';
347 $search_date_endmonth =
'';
348 $search_date_endyear =
'';
349 $search_date_start =
'';
350 $search_date_end =
'';
351 $search_date_end_startday =
'';
352 $search_date_end_startmonth =
'';
353 $search_date_end_startyear =
'';
354 $search_date_end_endday =
'';
355 $search_date_end_endmonth =
'';
356 $search_date_end_endyear =
'';
357 $search_date_end_start =
'';
358 $search_date_end_end =
'';
359 $search_date_delivery_startday =
'';
360 $search_date_delivery_startmonth =
'';
361 $search_date_delivery_startyear =
'';
362 $search_date_delivery_endday =
'';
363 $search_date_delivery_endmonth =
'';
364 $search_date_delivery_endyear =
'';
365 $search_date_delivery_start =
'';
366 $search_date_delivery_end =
'';
367 $search_availability =
'';
371 $search_array_options = array();
372 $search_categ_cus = 0;
373 $search_fk_cond_reglement =
'';
374 $search_fk_shipping_method =
'';
375 $search_fk_input_reason =
'';
376 $search_fk_mode_reglement =
'';
377 $search_date_signature_startday =
'';
378 $search_date_signature_startmonth =
'';
379 $search_date_signature_startyear =
'';
380 $search_date_signature_endday =
'';
381 $search_date_signature_endmonth =
'';
382 $search_date_signature_endyear =
'';
383 $search_date_signature_start =
'';
384 $search_date_signature_end =
'';
386 if ($object_statut !=
'') {
387 $search_status = $object_statut;
391 if (empty($reshook)) {
392 $objectclass =
'Propal';
393 $objectlabel =
'Proposals';
394 $uploaddir = $conf->propal->multidir_output[$conf->entity];
395 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
398 if ($action ==
'validate' && $permissiontovalidate) {
399 if (
GETPOST(
'confirm') ==
'yes') {
400 $tmpproposal =
new Propal($db);
403 foreach ($toselect as $checked) {
404 if ($tmpproposal->fetch($checked) > 0) {
405 if ($tmpproposal->statut == $tmpproposal::STATUS_DRAFT) {
406 if ($tmpproposal->valid($user) > 0) {
407 setEventMessages($langs->trans(
'hasBeenValidated', $tmpproposal->ref),
null,
'mesgs');
413 $langs->load(
"errors");
414 setEventMessages($langs->trans(
'ErrorIsNotADraft', $tmpproposal->ref),
null,
'errors');
430 if ($action ==
"sign" && $permissiontoclose) {
431 if (
GETPOST(
'confirm') ==
'yes') {
432 $tmpproposal =
new Propal($db);
435 foreach ($toselect as $checked) {
436 if ($tmpproposal->fetch($checked) > 0) {
437 if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED) {
438 $tmpproposal->statut = $tmpproposal::STATUS_SIGNED;
439 if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_SIGNED) >= 0) {
440 setEventMessages($tmpproposal->ref.
" ".$langs->trans(
'Signed'),
null,
'mesgs');
446 setEventMessage($langs->trans(
'MustBeValidatedToBeSigned', $tmpproposal->ref),
'errors');
462 if ($action ==
"nosign" && $permissiontoclose) {
463 if (
GETPOST(
'confirm') ==
'yes') {
464 $tmpproposal =
new Propal($db);
467 foreach ($toselect as $checked) {
468 if ($tmpproposal->fetch($checked) > 0) {
469 if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED || (!empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE) && $tmpproposal->statut == $tmpproposal::STATUS_DRAFT)) {
470 $tmpproposal->statut = $tmpproposal::STATUS_NOTSIGNED;
471 if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_NOTSIGNED) > 0) {
472 setEventMessage($tmpproposal->ref.
" ".$langs->trans(
'NoSigned'),
'mesgs');
478 setEventMessage($tmpproposal->ref.
" ".$langs->trans(
'CantBeNoSign'),
'errors');
495 if (!$error && $massaction ===
'setbilled' && $permissiontoclose) {
498 $objecttmp =
new $objectclass($db);
500 foreach ($toselect as $toselectid) {
501 $result = $objecttmp->fetch($toselectid);
503 $result = $objecttmp->classifyBilled($user, 0);
546 $companystatic =
new Societe($db);
547 $projectstatic =
new Project($db);
550 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
551 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
554 if ($sall || $search_user > 0) {
555 $sql =
'SELECT DISTINCT';
557 $sql .=
' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.phone, s.fax , s.address, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, ';
558 $sql .=
" typent.code as typent_code,";
559 $sql .=
" ava.rowid as availability,";
560 $sql .=
" country.code as country_code,";
561 $sql .=
" state.code_departement as state_code, state.nom as state_name,";
562 $sql .=
' p.rowid, p.entity as propal_entity, p.note_private, p.total_ht, p.total_tva, p.total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut as status, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,';
563 $sql .=
' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc,';
564 $sql .=
' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,';
565 $sql .=
' p.date_signature as dsignature,';
566 $sql .=
' p.note_public, p.note_private,';
567 $sql .=
' p.fk_cond_reglement,p.deposit_percent,p.fk_mode_reglement,p.fk_shipping_method,p.fk_input_reason,';
568 $sql .=
" pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
569 $sql .=
' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity as user_entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
570 if (empty($user->rights->societe->client->voir) && !$socid) {
571 $sql .=
", sc.fk_soc, sc.fk_user";
573 if (!empty($search_categ_cus) && $search_categ_cus !=
'-1') {
574 $sql .=
", cc.fk_categorie, cc.fk_soc";
577 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
578 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
579 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
583 $parameters = array();
584 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
585 $sql .= $hookmanager->resPrint;
586 $sql = preg_replace(
'/, $/',
'', $sql);
590 $sql .=
' FROM '.MAIN_DB_PREFIX.
'societe as s';
591 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
592 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
593 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
594 if (!empty($search_categ_cus) && $search_categ_cus !=
'-1') {
595 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
"categorie_societe as cc ON s.rowid = cc.fk_soc";
597 $sql .=
', '.MAIN_DB_PREFIX.
'propal as p';
598 if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
599 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (p.rowid = ef.fk_object)";
602 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'propaldet as pd ON p.rowid=pd.fk_propal';
604 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as u ON p.fk_user_author = u.rowid';
605 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as pr ON pr.rowid = p.fk_projet";
606 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_availability as ava on (ava.rowid = p.fk_availability)";
608 if ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid)) {
609 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
611 if ($search_user > 0) {
612 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as c";
613 $sql .=
", ".MAIN_DB_PREFIX.
"c_type_contact as tc";
617 $parameters = array();
618 $reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
619 $sql .= $hookmanager->resPrint;
621 $sql .=
' WHERE p.fk_soc = s.rowid';
622 $sql .=
' AND p.entity IN ('.getEntity(
'propal').
')';
623 if (empty($user->rights->societe->client->voir) && !$socid) {
624 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
636 if ($search_country) {
637 $sql .=
" AND s.fk_pays IN (".$db->sanitize($db->escape($search_country)).
')';
639 if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
640 $sql .=
" AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).
')';
645 if ($search_refcustomer) {
648 if ($search_refproject) {
651 if ($search_project) {
654 if ($search_availability) {
655 $sql .=
" AND p.fk_availability IN (".$db->sanitize($db->escape($search_availability)).
')';
657 if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_societe) {
658 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_societe);
660 if ($search_societe) {
663 if ($search_societe_alias) {
668 $sql .=
natural_search(array(
"u.login",
"u.firstname",
"u.lastname"), $search_login);
670 if ($search_montant_ht !=
'') {
673 if ($search_montant_vat !=
'') {
676 if ($search_montant_ttc !=
'') {
679 if ($search_warehouse !=
'' && $search_warehouse > 0) {
682 if ($search_multicurrency_code !=
'') {
683 $sql .=
" AND p.multicurrency_code = '".$db->escape($search_multicurrency_code).
"'";
685 if ($search_multicurrency_tx !=
'') {
686 $sql .=
natural_search(
'p.multicurrency_tx', $search_multicurrency_tx, 1);
688 if ($search_multicurrency_montant_ht !=
'') {
689 $sql .=
natural_search(
'p.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
691 if ($search_multicurrency_montant_vat !=
'') {
692 $sql .=
natural_search(
'p.multicurrency_total_tva', $search_multicurrency_montant_vat, 1);
694 if ($search_multicurrency_montant_ttc !=
'') {
695 $sql .=
natural_search(
'p.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
701 if ($search_categ_cus > 0) {
702 $sql .=
" AND cc.fk_categorie = ".((int) $search_categ_cus);
704 if ($search_categ_cus == -2) {
705 $sql .=
" AND cc.fk_categorie IS NULL";
708 if ($search_fk_cond_reglement > 0) {
709 $sql .=
" AND p.fk_cond_reglement = ".((int) $search_fk_cond_reglement);
711 if ($search_fk_shipping_method > 0) {
712 $sql .=
" AND p.fk_shipping_method = ".((int) $search_fk_shipping_method);
714 if ($search_fk_input_reason > 0) {
715 $sql .=
" AND p.fk_input_reason = ".((int) $search_fk_input_reason);
717 if ($search_fk_mode_reglement > 0) {
718 $sql .=
" AND p.fk_mode_reglement = ".((int) $search_fk_mode_reglement);
721 $sql .=
' AND s.rowid = '.((int) $socid);
723 if ($search_status !=
'' && $search_status !=
'-1') {
724 $sql .=
' AND p.fk_statut IN ('.$db->sanitize($search_status).
')';
726 if ($search_date_start) {
727 $sql .=
" AND p.datep >= '".$db->idate($search_date_start).
"'";
729 if ($search_date_end) {
730 $sql .=
" AND p.datep <= '".$db->idate($search_date_end).
"'";
732 if ($search_date_end_start) {
733 $sql .=
" AND p.fin_validite >= '".$db->idate($search_date_end_start).
"'";
735 if ($search_date_end_end) {
736 $sql .=
" AND p.fin_validite <= '".$db->idate($search_date_end_end).
"'";
738 if ($search_date_delivery_start) {
739 $sql .=
" AND p.date_livraison >= '".$db->idate($search_date_delivery_start).
"'";
741 if ($search_date_delivery_end) {
742 $sql .=
" AND p.date_livraison <= '".$db->idate($search_date_delivery_end).
"'";
744 if ($search_sale > 0) {
745 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale);
747 if ($search_user > 0) {
748 $sql .=
" AND c.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".((int) $search_user);
750 if ($search_date_signature_start) {
751 $sql .=
" AND p.date_signature >= '".$db->idate($search_date_signature_start).
"'";
753 if ($search_date_signature_end) {
754 $sql .=
" AND p.date_signature <= '".$db->idate($search_date_signature_end).
"'";
757 $searchCategoryProductOperator = -1;
758 $searchCategoryProductList = array($search_product_category);
759 if (!empty($searchCategoryProductList)) {
760 $searchCategoryProductSqlList = array();
761 $listofcategoryid =
'';
762 foreach ($searchCategoryProductList as $searchCategoryProduct) {
763 if (intval($searchCategoryProduct) == -2) {
764 $searchCategoryProductSqlList[] =
"NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product)";
765 } elseif (intval($searchCategoryProduct) > 0) {
766 if ($searchCategoryProductOperator == 0) {
767 $searchCategoryProductSqlList[] =
" EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).
")";
769 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProduct);
773 if ($listofcategoryid) {
774 $searchCategoryProductSqlList[] =
" EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
776 if ($searchCategoryProductOperator == 1) {
777 if (!empty($searchCategoryProductSqlList)) {
778 $sql .=
" AND (".implode(
' OR ', $searchCategoryProductSqlList).
")";
781 if (!empty($searchCategoryProductSqlList)) {
782 $sql .=
" AND (".implode(
' AND ', $searchCategoryProductSqlList).
")";
787 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
790 $parameters = array();
791 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
792 $sql .= $hookmanager->resPrint;
795 $parameters = array();
796 $reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object, $action);
797 $sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
801 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
803 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
804 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
805 $resql = $db->query($sqlforcount);
807 $objforcount = $db->fetch_object(
$resql);
820 $sql .= $db->order($sortfield, $sortorder);
821 $sql .=
', p.ref DESC';
823 $sql .= $db->plimit($limit + 1, $offset);
826 $resql = $db->query($sql);
829 $objectstatic =
new Propal($db);
830 $userstatic =
new User($db);
835 $title = $langs->trans(
'Proposals').
' - '.$soc->name;
836 if (empty($search_societe)) {
837 $search_societe = $soc->name;
840 $title = $langs->trans(
'Proposals');
843 $num = $db->num_rows(
$resql);
845 $arrayofselected = is_array($toselect) ? $toselect : array();
847 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) {
848 $obj = $db->fetch_object(
$resql);
852 header(
"Location: ".DOL_URL_ROOT.
'/comm/propal/card.php?id='.$id);
856 $help_url =
'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos';
859 $param =
'&search_status='.urlencode($search_status);
860 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
861 $param .=
'&contextpage='.urlencode($contextpage);
863 if ($limit > 0 && $limit != $conf->liste_limit) {
864 $param .=
'&limit='.urlencode($limit);
867 $param .=
'&sall='.urlencode($sall);
869 if ($search_date_startday) {
870 $param .=
'&search_date_startday='.urlencode($search_date_startday);
872 if ($search_date_startmonth) {
873 $param .=
'&search_date_startmonth='.urlencode($search_date_startmonth);
875 if ($search_date_startyear) {
876 $param .=
'&search_date_startyear='.urlencode($search_date_startyear);
878 if ($search_date_endday) {
879 $param .=
'&search_date_endday='.urlencode($search_date_endday);
881 if ($search_date_endmonth) {
882 $param .=
'&search_date_endmonth='.urlencode($search_date_endmonth);
884 if ($search_date_endyear) {
885 $param .=
'&search_date_endyear='.urlencode($search_date_endyear);
887 if ($search_date_end_startday) {
888 $param .=
'&search_date_end_startday='.urlencode($search_date_end_startday);
890 if ($search_date_end_startmonth) {
891 $param .=
'&search_date_end_startmonth='.urlencode($search_date_end_startmonth);
893 if ($search_date_end_startyear) {
894 $param .=
'&search_date_end_startyear='.urlencode($search_date_end_startyear);
896 if ($search_date_end_endday) {
897 $param .=
'&search_date_end_endday='.urlencode($search_date_end_endday);
899 if ($search_date_end_endmonth) {
900 $param .=
'&search_date_end_endmonth='.urlencode($search_date_end_endmonth);
902 if ($search_date_end_endyear) {
903 $param .=
'&search_date_end_endyear='.urlencode($search_date_end_endyear);
905 if ($search_date_delivery_startday) {
906 $param .=
'&search_date_delivery_startday='.urlencode($search_date_delivery_startday);
908 if ($search_date_delivery_startmonth) {
909 $param .=
'&search_date_delivery_startmonth='.urlencode($search_date_delivery_startmonth);
911 if ($search_date_delivery_startyear) {
912 $param .=
'&search_date_delivery_startyear='.urlencode($search_date_delivery_startyear);
914 if ($search_date_delivery_endday) {
915 $param .=
'&search_date_delivery_endday='.urlencode($search_date_delivery_endday);
917 if ($search_date_delivery_endmonth) {
918 $param .=
'&search_date_delivery_endmonth='.urlencode($search_date_delivery_endmonth);
920 if ($search_date_delivery_endyear) {
921 $param .=
'&search_date_delivery_endyear='.urlencode($search_date_delivery_endyear);
924 $param .=
'&search_ref='.urlencode($search_ref);
926 if ($search_refcustomer) {
927 $param .=
'&search_refcustomer='.urlencode($search_refcustomer);
929 if ($search_refproject) {
930 $param .=
'&search_refproject='.urlencode($search_refproject);
932 if ($search_societe) {
933 $param .=
'&search_societe='.urlencode($search_societe);
935 if ($search_societe_alias) {
936 $param .=
'&search_societe_alias='.urlencode($search_societe_alias);
938 if ($search_user > 0) {
939 $param .=
'&search_user='.urlencode($search_user);
941 if ($search_sale > 0) {
942 $param .=
'&search_sale='.urlencode($search_sale);
944 if ($search_montant_ht) {
945 $param .=
'&search_montant_ht='.urlencode($search_montant_ht);
947 if ($search_multicurrency_code !=
'') {
948 $param .=
'&search_multicurrency_code='.urlencode($search_multicurrency_code);
950 if ($search_multicurrency_tx !=
'') {
951 $param .=
'&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
953 if ($search_multicurrency_montant_ht !=
'') {
954 $param .=
'&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
956 if ($search_multicurrency_montant_vat !=
'') {
957 $param .=
'&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
959 if ($search_multicurrency_montant_ttc !=
'') {
960 $param .=
'&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
963 $param .=
'&search_login='.urlencode($search_login);
966 $param .=
'&search_town='.urlencode($search_town);
969 $param .=
'&search_zip='.urlencode($search_zip);
972 $param .=
'&socid='.urlencode($socid);
974 if ($optioncss !=
'') {
975 $param .=
'&optioncss='.urlencode($optioncss);
977 if ($search_categ_cus > 0) {
978 $param .=
'&search_categ_cus='.urlencode($search_categ_cus);
980 if ($search_product_category !=
'') {
981 $param .=
'&search_product_category='.urlencode($search_product_category);
983 if ($search_fk_cond_reglement > 0) {
984 $param .=
'&search_fk_cond_reglement='.urlencode($search_fk_cond_reglement);
986 if ($search_fk_shipping_method > 0) {
987 $param .=
'&search_fk_shipping_method='.urlencode($search_fk_shipping_method);
989 if ($search_fk_input_reason > 0) {
990 $param .=
'&search_fk_input_reason='.urlencode($search_fk_input_reason);
992 if ($search_fk_mode_reglement > 0) {
993 $param .=
'&search_fk_mode_reglement='.urlencode($search_fk_mode_reglement);
995 if ($search_type_thirdparty > 0) {
996 $param .=
'&search_type_thirdparty='.urlencode($search_type_thirdparty);
999 $param .=
'&search_town='.urlencode($search_town);
1002 $param .=
'&search_zip='.urlencode($search_zip);
1004 if ($search_state) {
1005 $param .=
'&search_state='.urlencode($search_state);
1008 $param .=
'&search_town='.urlencode($search_town);
1010 if ($search_country) {
1011 $param .=
'&search_country='.urlencode($search_country);
1013 if ($search_date_signature_startday) {
1014 $param .=
'&search_date_signature_startday='.urlencode($search_date_signature_startday);
1016 if ($search_date_signature_startmonth) {
1017 $param .=
'&search_date_signature_startmonth='.urlencode($search_date_signature_startmonth);
1019 if ($search_date_signature_startyear) {
1020 $param .=
'&search_date_signature_startyear='.urlencode($search_date_signature_startyear);
1022 if ($search_date_signature_endday) {
1023 $param .=
'&search_date_signature_endday='.urlencode($search_date_signature_endday);
1025 if ($search_date_signature_endmonth) {
1026 $param .=
'&search_date_signature_endmonth='.urlencode($search_date_signature_endmonth);
1028 if ($search_date_signature_endyear) {
1029 $param .=
'&search_date_signature_endyear='.urlencode($search_date_signature_endyear);
1033 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
1035 $parameters = array();
1036 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
1037 $param .= $hookmanager->resPrint;
1040 $arrayofmassactions = array(
1041 'generate_doc'=>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
1042 'builddoc'=>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"PDFMerge"),
1044 if ($permissiontosendbymail) {
1045 $arrayofmassactions[
'presend']=
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail");
1047 if ($permissiontovalidate) {
1048 $arrayofmassactions[
'prevalidate']=
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate");
1050 if ($permissiontoclose) {
1051 $arrayofmassactions[
'presign']=
img_picto(
'',
'propal',
'class="pictofixedwidth"').$langs->trans(
"Sign");
1052 $arrayofmassactions[
'nopresign']=
img_picto(
'',
'propal',
'class="pictofixedwidth"').$langs->trans(
"NoSign");
1053 $arrayofmassactions[
'setbilled'] =
img_picto(
'',
'bill',
'class="pictofixedwidth"').$langs->trans(
"ClassifyBilled");
1055 if ($permissiontodelete) {
1056 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
1059 if (in_array($massaction, array(
'presend',
'predelete',
'closed'))) {
1060 $arrayofmassactions = array();
1062 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
1064 $url = DOL_URL_ROOT.
'/comm/propal/card.php?action=create';
1065 if (!empty($socid)) {
1066 $url .=
'&socid='.$socid;
1068 $newcardbutton =
dolGetButtonTitle($langs->trans(
'NewPropal'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->propal->creer);
1071 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
1072 if ($optioncss !=
'') {
1073 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1075 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1076 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1077 print
'<input type="hidden" name="action" value="list">';
1078 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1079 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1080 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
1082 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'propal', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1084 $topicmail =
"SendPropalRef";
1085 $modelmail =
"propal_send";
1086 $objecttmp =
new Propal($db);
1087 $trackid =
'pro'.$object->id;
1088 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1090 if ($massaction ==
'prevalidate') {
1091 print
$form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassValidation"), $langs->trans(
"ConfirmMassValidationQuestion"),
"validate",
null,
'', 0, 200, 500, 1);
1094 if ($massaction ==
'presign') {
1095 print
$form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassSignature"), $langs->trans(
"ConfirmMassSignatureQuestion"),
"sign",
null,
'', 0, 200, 500, 1);
1098 if ($massaction ==
'nopresign') {
1099 print
$form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassNoSignature"), $langs->trans(
"ConfirmMassNoSignatureQuestion"),
"nosign",
null,
'', 0, 200, 500, 1);
1103 foreach ($fieldstosearchall as $key => $val) {
1104 $fieldstosearchall[$key] = $langs->trans($val);
1106 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $sall).join(
', ', $fieldstosearchall).
'</div>';
1111 $moreforfilter =
'';
1114 if ($user->rights->user->user->lire) {
1115 $langs->load(
"commercial");
1116 $moreforfilter .=
'<div class="divsearchfield">';
1117 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1118 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth250 widthcentpercentminusx');
1119 $moreforfilter .=
'</div>';
1122 if ($user->rights->user->user->lire) {
1123 $moreforfilter .=
'<div class="divsearchfield">';
1124 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
1125 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$form->select_dolusers($search_user,
'search_user', $tmptitle,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth250 widthcentpercentminusx');
1126 $moreforfilter .=
'</div>';
1129 if (
isModEnabled(
'categorie') && $user->hasRight(
'categorie',
'read') && ($user->hasRight(
'product',
'read') || $user->hasRight(
'service',
'read'))) {
1130 $searchCategoryProductOperator = -1;
1131 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1132 $tmptitle = $langs->trans(
'IncludingProductWithTag');
1134 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, array($search_product_category),
'maxwidth300', $searchCategoryProductOperator, 0, 0, $tmptitle);
1136 if (
isModEnabled(
'categorie') && $user->rights->categorie->lire) {
1137 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1138 $moreforfilter .=
'<div class="divsearchfield">';
1139 $tmptitle = $langs->trans(
'CustomersProspectsCategoriesShort');
1140 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"').$formother->select_categories(
'customer', $search_categ_cus,
'search_categ_cus', 1, $tmptitle, (empty($conf->dol_optimize_smallscreen) ?
'maxwidth300 widthcentpercentminusx' :
'maxwidth250 widthcentpercentminusx'));
1141 $moreforfilter .=
'</div>';
1143 if (
isModEnabled(
'stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) {
1144 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
1146 $moreforfilter .=
'<div class="divsearchfield">';
1147 $tmptitle = $langs->trans(
'Warehouse');
1148 $moreforfilter .=
img_picto($tmptitle,
'stock',
'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse,
'search_warehouse',
'', $tmptitle, 0, 0, $tmptitle);
1149 $moreforfilter .=
'</div>';
1151 $parameters = array();
1152 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1153 if (empty($reshook)) {
1154 $moreforfilter .= $hookmanager->resPrint;
1156 $moreforfilter = $hookmanager->resPrint;
1159 if (!empty($moreforfilter)) {
1160 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1161 print $moreforfilter;
1165 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1166 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
''));
1167 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
1169 print
'<div class="div-table-responsive">';
1170 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1172 print
'<tr class="liste_titre_filter">';
1175 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1176 print
'<td class="liste_titre" align="middle">';
1177 $searchpicto =
$form->showFilterButtons(
'left');
1182 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1183 print
'<td class="liste_titre">';
1184 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
1187 if (!empty($arrayfields[
'p.ref_client'][
'checked'])) {
1188 print
'<td class="liste_titre">';
1189 print
'<input class="flat maxwidth50" type="text" name="search_refcustomer" value="'.dol_escape_htmltag($search_refcustomer).
'">';
1192 if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1193 print
'<td class="liste_titre">';
1194 print
'<input class="flat maxwidth50" type="text" name="search_refproject" value="'.dol_escape_htmltag($search_refproject).
'">';
1197 if (!empty($arrayfields[
'pr.title'][
'checked'])) {
1198 print
'<td class="liste_titre">';
1199 print
'<input class="flat maxwidth50" type="text" name="search_project" value="'.dol_escape_htmltag($search_project).
'">';
1202 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1203 print
'<td class="liste_titre" align="left">';
1204 print
'<input class="flat maxwidth100" type="text" name="search_societe" value="'.dol_escape_htmltag($search_societe).
'">';
1207 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1208 print
'<td class="liste_titre" align="left">';
1209 print
'<input class="flat maxwidth100" type="text" name="search_societe_alias" value="'.dol_escape_htmltag($search_societe_alias).
'">';
1212 if (!empty($arrayfields[
's.town'][
'checked'])) {
1213 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_town" value="'.$search_town.
'"></td>';
1215 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1216 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_zip" value="'.$search_zip.
'"></td>';
1219 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1220 print
'<td class="liste_titre">';
1221 print
'<input class="flat maxwidth50" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1225 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1226 print
'<td class="liste_titre" align="center">';
1227 print
$form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1231 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1232 print
'<td class="liste_titre maxwidth100onsmartphone" align="center">';
1233 print
$form->selectarray(
"search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0,
'', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ?
'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT),
'', 1);
1238 if (!empty($arrayfields[
'p.date'][
'checked'])) {
1239 print
'<td class="liste_titre center">';
1240 print
'<div class="nowrap">';
1241 print
$form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1243 print
'<div class="nowrap">';
1244 print
$form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1249 if (!empty($arrayfields[
'p.fin_validite'][
'checked'])) {
1250 print
'<td class="liste_titre center">';
1251 print
'<div class="nowrap">';
1252 print
$form->selectDate($search_date_end_start ? $search_date_end_start : -1,
'search_date_end_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1254 print
'<div class="nowrap">';
1255 print
$form->selectDate($search_date_end_end ? $search_date_end_end : -1,
'search_date_end_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1260 if (!empty($arrayfields[
'p.date_livraison'][
'checked'])) {
1261 print
'<td class="liste_titre center">';
1262 print
'<div class="nowrap">';
1263 print
$form->selectDate($search_date_delivery_start ? $search_date_delivery_start : -1,
'search_date_delivery_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1265 print
'<div class="nowrap">';
1266 print
$form->selectDate($search_date_delivery_end ? $search_date_delivery_end : -1,
'search_date_delivery_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1271 if (!empty($arrayfields[
'p.date_signature'][
'checked'])) {
1272 print
'<td class="liste_titre center">';
1273 print
'<div class="nowrap">';
1274 print
$form->selectDate($search_date_signature_start ? $search_date_signature_start : -1,
'search_date_signature_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1276 print
'<div class="nowrap">';
1277 print
$form->selectDate($search_date_signature_end ? $search_date_signature_end : -1,
'search_date_signature_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1282 if (!empty($arrayfields[
'ava.rowid'][
'checked'])) {
1283 print
'<td class="liste_titre maxwidth100onsmartphone center">';
1284 $form->selectAvailabilityDelay($search_availability,
'search_availability',
'', 1);
1289 if (!empty($arrayfields[
'p.fk_shipping_method'][
'checked'])) {
1290 print
'<td class="liste_titre">';
1291 $form->selectShippingMethod($search_fk_shipping_method,
'search_fk_shipping_method',
'', 1,
'', 1);
1295 if (!empty($arrayfields[
'p.fk_input_reason'][
'checked'])) {
1296 print
'<td class="liste_titre">';
1297 $form->selectInputReason($search_fk_input_reason,
'search_fk_input_reason',
'', 1,
'maxwidth125', 1);
1301 if (!empty($arrayfields[
'p.fk_cond_reglement'][
'checked'])) {
1302 print
'<td class="liste_titre">';
1303 print
$form->getSelectConditionsPaiements($search_fk_cond_reglement,
'search_fk_cond_reglement', 1, 1, 1);
1307 if (!empty($arrayfields[
'p.fk_mode_reglement'][
'checked'])) {
1308 print
'<td class="liste_titre">';
1309 print
$form->select_types_paiements($search_fk_mode_reglement,
'search_fk_mode_reglement',
'', 0, 1, 1, 0, -1,
'', 1);
1312 if (!empty($arrayfields[
'p.total_ht'][
'checked'])) {
1314 print
'<td class="liste_titre right">';
1315 print
'<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).
'">';
1318 if (!empty($arrayfields[
'p.total_tva'][
'checked'])) {
1320 print
'<td class="liste_titre right">';
1321 print
'<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).
'">';
1324 if (!empty($arrayfields[
'p.total_ttc'][
'checked'])) {
1326 print
'<td class="liste_titre right">';
1327 print
'<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).
'">';
1330 if (!empty($arrayfields[
'p.total_ht_invoiced'][
'checked'])) {
1332 print
'<td class="liste_titre right">';
1335 if (!empty($arrayfields[
'p.total_invoiced'][
'checked'])) {
1337 print
'<td class="liste_titre right">';
1340 if (!empty($arrayfields[
'p.multicurrency_code'][
'checked'])) {
1342 print
'<td class="liste_titre">';
1343 print
$form->selectMultiCurrency($search_multicurrency_code,
'search_multicurrency_code', 1);
1346 if (!empty($arrayfields[
'p.multicurrency_tx'][
'checked'])) {
1348 print
'<td class="liste_titre">';
1349 print
'<input class="flat" type="text" size="4" name="search_multicurrency_tx" value="'.dol_escape_htmltag($search_multicurrency_tx).
'">';
1352 if (!empty($arrayfields[
'p.multicurrency_total_ht'][
'checked'])) {
1354 print
'<td class="liste_titre right">';
1355 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ht" value="'.dol_escape_htmltag($search_multicurrency_montant_ht).
'">';
1358 if (!empty($arrayfields[
'p.multicurrency_total_tva'][
'checked'])) {
1360 print
'<td class="liste_titre right">';
1361 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_vat" value="'.dol_escape_htmltag($search_multicurrency_montant_vat).
'">';
1364 if (!empty($arrayfields[
'p.multicurrency_total_ttc'][
'checked'])) {
1366 print
'<td class="liste_titre right">';
1367 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ttc" value="'.dol_escape_htmltag($search_multicurrency_montant_ttc).
'">';
1370 if (!empty($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'checked'])) {
1372 print
'<td class="liste_titre right">';
1375 if (!empty($arrayfields[
'p.multicurrency_total_invoiced'][
'checked'])) {
1377 print
'<td class="liste_titre right">';
1380 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1382 print
'<td class="liste_titre" align="center">';
1383 print
'<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1386 if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
1387 print
'<td class="liste_titre"></td>';
1389 if (!empty($arrayfields[
'total_pa'][
'checked'])) {
1390 print
'<td class="liste_titre right">';
1393 if (!empty($arrayfields[
'total_margin'][
'checked'])) {
1394 print
'<td class="liste_titre right">';
1397 if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
1398 print
'<td class="liste_titre right">';
1401 if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
1402 print
'<td class="liste_titre right">';
1406 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1409 $parameters = array(
'arrayfields'=>$arrayfields);
1410 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1411 print $hookmanager->resPrint;
1413 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1414 print
'<td class="liste_titre">';
1418 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1419 print
'<td class="liste_titre">';
1423 if (!empty($arrayfields[
'p.date_cloture'][
'checked'])) {
1424 print
'<td class="liste_titre">';
1427 if (!empty($arrayfields[
'p.note_public'][
'checked'])) {
1429 print
'<td class="liste_titre">';
1432 if (!empty($arrayfields[
'p.note_private'][
'checked'])) {
1434 print
'<td class="liste_titre">';
1438 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1439 print
'<td class="liste_titre maxwidthonsmartphone right">';
1440 $formpropal->selectProposalStatus($search_status, 1, 0, 1,
'customer',
'search_statut',
'search_status maxwidth125 onrightofpage');
1444 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1445 print
'<td class="liste_titre" align="middle">';
1446 $searchpicto =
$form->showFilterButtons();
1452 $totalarray = array(
1462 print
'<tr class="liste_titre">';
1463 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1464 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
1466 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1467 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'p.ref',
'', $param,
'', $sortfield, $sortorder);
1469 if (!empty($arrayfields[
'p.ref_client'][
'checked'])) {
1470 print_liste_field_titre($arrayfields[
'p.ref_client'][
'label'], $_SERVER[
"PHP_SELF"],
'p.ref_client',
'', $param,
'', $sortfield, $sortorder);
1472 if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1473 print_liste_field_titre($arrayfields[
'pr.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'pr.ref',
'', $param,
'', $sortfield, $sortorder);
1475 if (!empty($arrayfields[
'pr.title'][
'checked'])) {
1476 print_liste_field_titre($arrayfields[
'pr.title'][
'label'], $_SERVER[
"PHP_SELF"],
'pr.title',
'', $param,
'', $sortfield, $sortorder);
1478 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1479 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
's.nom',
'', $param,
'', $sortfield, $sortorder);
1481 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1482 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
's.name_alias',
'', $param,
'', $sortfield, $sortorder);
1484 if (!empty($arrayfields[
's.town'][
'checked'])) {
1485 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
1487 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1488 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
1490 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1491 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1493 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1494 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'class="center"', $sortfield, $sortorder);
1496 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1497 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'class="center"', $sortfield, $sortorder);
1499 if (!empty($arrayfields[
'p.date'][
'checked'])) {
1500 print_liste_field_titre($arrayfields[
'p.date'][
'label'], $_SERVER[
"PHP_SELF"],
'p.datep',
'', $param,
'class="center"', $sortfield, $sortorder);
1502 if (!empty($arrayfields[
'p.fin_validite'][
'checked'])) {
1503 print_liste_field_titre($arrayfields[
'p.fin_validite'][
'label'], $_SERVER[
"PHP_SELF"],
'dfv',
'', $param,
'class="center"', $sortfield, $sortorder);
1505 if (!empty($arrayfields[
'p.date_livraison'][
'checked'])) {
1506 print_liste_field_titre($arrayfields[
'p.date_livraison'][
'label'], $_SERVER[
"PHP_SELF"],
'p.date_livraison',
'', $param,
'class="center"', $sortfield, $sortorder);
1508 if (!empty($arrayfields[
'p.date_signature'][
'checked'])) {
1509 print_liste_field_titre($arrayfields[
'p.date_signature'][
'label'], $_SERVER[
"PHP_SELF"],
'p.date_signature',
'', $param,
'class="center"', $sortfield, $sortorder);
1511 if (!empty($arrayfields[
'ava.rowid'][
'checked'])) {
1512 print_liste_field_titre($arrayfields[
'ava.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
'availability',
'', $param,
'', $sortfield, $sortorder);
1514 if (!empty($arrayfields[
'p.fk_shipping_method'][
'checked'])) {
1515 print_liste_field_titre($arrayfields[
'p.fk_shipping_method'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_shipping_method",
"", $param,
'', $sortfield, $sortorder);
1517 if (!empty($arrayfields[
'p.fk_input_reason'][
'checked'])) {
1518 print_liste_field_titre($arrayfields[
'p.fk_input_reason'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_input_reason",
"", $param,
'', $sortfield, $sortorder);
1520 if (!empty($arrayfields[
'p.fk_cond_reglement'][
'checked'])) {
1521 print_liste_field_titre($arrayfields[
'p.fk_cond_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_cond_reglement",
"", $param,
'', $sortfield, $sortorder);
1523 if (!empty($arrayfields[
'p.fk_mode_reglement'][
'checked'])) {
1524 print_liste_field_titre($arrayfields[
'p.fk_mode_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_mode_reglement",
"", $param,
'', $sortfield, $sortorder);
1526 if (!empty($arrayfields[
'p.total_ht'][
'checked'])) {
1527 print_liste_field_titre($arrayfields[
'p.total_ht'][
'label'], $_SERVER[
"PHP_SELF"],
'p.total_ht',
'', $param,
'class="right"', $sortfield, $sortorder);
1529 if (!empty($arrayfields[
'p.total_tva'][
'checked'])) {
1530 print_liste_field_titre($arrayfields[
'p.total_tva'][
'label'], $_SERVER[
"PHP_SELF"],
'p.total_tva',
'', $param,
'class="right"', $sortfield, $sortorder);
1532 if (!empty($arrayfields[
'p.total_ttc'][
'checked'])) {
1533 print_liste_field_titre($arrayfields[
'p.total_ttc'][
'label'], $_SERVER[
"PHP_SELF"],
'p.total_ttc',
'', $param,
'class="right"', $sortfield, $sortorder);
1535 if (!empty($arrayfields[
'p.total_ht_invoiced'][
'checked'])) {
1536 print_liste_field_titre($arrayfields[
'p.total_ht_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1538 if (!empty($arrayfields[
'p.total_invoiced'][
'checked'])) {
1539 print_liste_field_titre($arrayfields[
'p.total_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1541 if (!empty($arrayfields[
'p.multicurrency_code'][
'checked'])) {
1542 print_liste_field_titre($arrayfields[
'p.multicurrency_code'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_code',
'', $param,
'', $sortfield, $sortorder);
1544 if (!empty($arrayfields[
'p.multicurrency_tx'][
'checked'])) {
1545 print_liste_field_titre($arrayfields[
'p.multicurrency_tx'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_tx',
'', $param,
'', $sortfield, $sortorder);
1547 if (!empty($arrayfields[
'p.multicurrency_total_ht'][
'checked'])) {
1548 print_liste_field_titre($arrayfields[
'p.multicurrency_total_ht'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_total_ht',
'', $param,
'class="right"', $sortfield, $sortorder);
1550 if (!empty($arrayfields[
'p.multicurrency_total_tva'][
'checked'])) {
1551 print_liste_field_titre($arrayfields[
'p.multicurrency_total_tva'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_total_tva',
'', $param,
'class="right"', $sortfield, $sortorder);
1553 if (!empty($arrayfields[
'p.multicurrency_total_ttc'][
'checked'])) {
1554 print_liste_field_titre($arrayfields[
'p.multicurrency_total_ttc'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_total_ttc',
'', $param,
'class="right"', $sortfield, $sortorder);
1556 if (!empty($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'checked'])) {
1557 print_liste_field_titre($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1559 if (!empty($arrayfields[
'p.multicurrency_total_invoiced'][
'checked'])) {
1560 print_liste_field_titre($arrayfields[
'p.multicurrency_total_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1562 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1563 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'class="center"', $sortfield, $sortorder);
1565 if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
1566 print_liste_field_titre($arrayfields[
'sale_representative'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"",
"$param",
'', $sortfield, $sortorder);
1568 if (!empty($arrayfields[
'total_pa'][
'checked'])) {
1569 print_liste_field_titre($arrayfields[
'total_pa'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1571 if (!empty($arrayfields[
'total_margin'][
'checked'])) {
1572 print_liste_field_titre($arrayfields[
'total_margin'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1574 if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
1575 print_liste_field_titre($arrayfields[
'total_margin_rate'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1577 if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
1578 print_liste_field_titre($arrayfields[
'total_mark_rate'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1581 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1583 $parameters = array(
1584 'arrayfields' => $arrayfields,
1586 'sortfield' => $sortfield,
1587 'sortorder' => $sortorder,
1588 'totalarray' => &$totalarray,
1591 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1593 print $hookmanager->resPrint;
1594 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1595 print_liste_field_titre($arrayfields[
'p.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datec",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
1597 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1598 print_liste_field_titre($arrayfields[
'p.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"p.tms",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
1600 if (!empty($arrayfields[
'p.date_cloture'][
'checked'])) {
1601 print_liste_field_titre($arrayfields[
'p.date_cloture'][
'label'], $_SERVER[
"PHP_SELF"],
"p.date_cloture",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
1603 if (!empty($arrayfields[
'p.note_public'][
'checked'])) {
1604 print_liste_field_titre($arrayfields[
'p.note_public'][
'label'], $_SERVER[
"PHP_SELF"],
"p.note_public",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1606 if (!empty($arrayfields[
'p.note_private'][
'checked'])) {
1607 print_liste_field_titre($arrayfields[
'p.note_private'][
'label'], $_SERVER[
"PHP_SELF"],
"p.note_private",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1609 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1610 print_liste_field_titre($arrayfields[
'p.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_statut",
"", $param,
'class="right"', $sortfield, $sortorder);
1612 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1613 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
1621 $with_margin_info =
false;
1623 !empty($arrayfields[
'total_pa'][
'checked'])
1624 || !empty($arrayfields[
'total_margin'][
'checked'])
1625 || !empty($arrayfields[
'total_margin_rate'][
'checked'])
1626 || !empty($arrayfields[
'total_mark_rate'][
'checked'])
1629 $with_margin_info =
true;
1634 $savnbfield = $totalarray[
'nbfield'];
1635 $totalarray = array();
1636 $totalarray[
'nbfield'] = 0;
1638 $imaxinloop = ($limit ? min($num, $limit) : $num);
1639 while ($i < $imaxinloop) {
1640 $obj = $db->fetch_object(
$resql);
1642 $objectstatic->id = $obj->rowid;
1643 $objectstatic->ref = $obj->ref;
1644 $objectstatic->ref_client = $obj->ref_client;
1645 $objectstatic->note_public = $obj->note_public;
1646 $objectstatic->note_private = $obj->note_private;
1647 $objectstatic->statut = $obj->status;
1648 $objectstatic->status = $obj->status;
1650 $companystatic->id = $obj->socid;
1651 $companystatic->name = $obj->name;
1652 $companystatic->name_alias = $obj->alias;
1653 $companystatic->client = $obj->client;
1654 $companystatic->fournisseur = $obj->fournisseur;
1655 $companystatic->code_client = $obj->code_client;
1656 $companystatic->email = $obj->email;
1657 $companystatic->phone = $obj->phone;
1658 $companystatic->address = $obj->address;
1659 $companystatic->zip = $obj->zip;
1660 $companystatic->town = $obj->town;
1661 $companystatic->country_code = $obj->country_code;
1663 $projectstatic->id = $obj->project_id;
1664 $projectstatic->ref = $obj->project_ref;
1665 $projectstatic->title = $obj->project_label;
1667 $totalInvoicedHT = 0;
1668 $totalInvoicedTTC = 0;
1669 $multicurrency_totalInvoicedHT = 0;
1670 $multicurrency_totalInvoicedTTC = 0;
1672 $TInvoiceData = $objectstatic->InvoiceArrayList($obj->rowid);
1674 if (!empty($TInvoiceData)) {
1675 foreach ($TInvoiceData as $invoiceData) {
1677 $invoice->fetch($invoiceData->facid);
1679 if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) && $invoice->type ==
Facture::TYPE_DEPOSIT) {
1683 $totalInvoicedHT += $invoice->total_ht;
1684 $totalInvoicedTTC += $invoice->total_ttc;
1685 $multicurrency_totalInvoicedHT += $invoice->multicurrency_total_ht;
1686 $multicurrency_totalInvoicedTTC += $invoice->multicurrency_total_ttc;
1690 $marginInfo = array();
1691 if ($with_margin_info ===
true) {
1692 $objectstatic->fetch_lines();
1693 $marginInfo = $formmargin->getMarginInfosArray($objectstatic);
1694 $total_ht += $obj->total_ht;
1695 $total_margin += $marginInfo[
'total_margin'];
1698 print
'<tr class="oddeven">';
1701 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1702 print
'<td class="nowrap" align="center">';
1703 if ($massactionbutton || $massaction) {
1705 if (in_array($obj->rowid, $arrayofselected)) {
1708 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1712 $totalarray[
'nbfield']++;
1716 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1717 print
'<td class="nowraponall">';
1719 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1721 print
'<td class="nobordernopadding nowraponall">';
1722 print $objectstatic->getNomUrl(1,
'',
'', 0, 1, (isset($conf->global->PROPAL_LIST_SHOW_NOTES) ? $conf->global->PROPAL_LIST_SHOW_NOTES : 1));
1726 if ($obj->status ==
Propal::STATUS_VALIDATED && $db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) {
1727 $warnornote .=
img_warning($langs->trans(
"Late"));
1730 print
'<td style="min-width: 20px" class="nobordernopadding nowrap">';
1735 print
'<td width="16" class="nobordernopadding right">';
1737 $filedir = $conf->propal->multidir_output[$obj->propal_entity].
'/'.
dol_sanitizeFileName($obj->ref);
1738 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
1739 print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
1740 print
'</td></tr></table>';
1744 $totalarray[
'nbfield']++;
1748 if (!empty($arrayfields[
'p.ref_client'][
'checked'])) {
1750 print
'<td class="nowrap tdoverflowmax200">';
1754 $totalarray[
'nbfield']++;
1758 if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1760 print
'<td class="nowraponall">';
1761 if ($obj->project_id > 0) {
1762 print $projectstatic->getNomUrl(1);
1766 $totalarray[
'nbfield']++;
1770 if (!empty($arrayfields[
'pr.title'][
'checked'])) {
1772 print
'<td class="nowrap">';
1773 if ($obj->project_id > 0) {
1778 $totalarray[
'nbfield']++;
1783 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1784 print
'<td class="tdoverflowmax150">';
1785 print $companystatic->getNomUrl(1,
'customer', 0, 0, 1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
1788 $totalarray[
'nbfield']++;
1793 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1794 print
'<td class="tdoverflowmax200">';
1798 $totalarray[
'nbfield']++;
1803 if (!empty($arrayfields[
's.town'][
'checked'])) {
1804 print
'<td class="nocellnopadd">';
1808 $totalarray[
'nbfield']++;
1812 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1813 print
'<td class="nocellnopadd">';
1817 $totalarray[
'nbfield']++;
1821 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1822 print
"<td>".$obj->state_name.
"</td>\n";
1824 $totalarray[
'nbfield']++;
1828 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1829 print
'<td class="center">';
1830 $tmparray =
getCountry($obj->fk_pays,
'all');
1831 print $tmparray[
'label'];
1834 $totalarray[
'nbfield']++;
1838 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1839 if (!is_array($typenArray) || empty($typenArray)) {
1840 $typenArray = $formcompany->typent_array(1);
1843 print
'<td class="center">';
1844 print $typenArray[$obj->typent_code];
1847 $totalarray[
'nbfield']++;
1852 if (!empty($arrayfields[
'p.date'][
'checked'])) {
1853 print
'<td class="center">';
1857 $totalarray[
'nbfield']++;
1862 if (!empty($arrayfields[
'p.fin_validite'][
'checked'])) {
1864 print
'<td class="center">'.dol_print_date($db->jdate($obj->dfv),
'day');
1867 print
'<td> </td>';
1870 $totalarray[
'nbfield']++;
1874 if (!empty($arrayfields[
'p.date_livraison'][
'checked'])) {
1875 if ($obj->ddelivery) {
1876 print
'<td class="center">'.dol_print_date($db->jdate($obj->ddelivery),
'day');
1879 print
'<td> </td>';
1882 $totalarray[
'nbfield']++;
1886 if (!empty($arrayfields[
'p.date_signature'][
'checked'])) {
1887 if ($obj->dsignature) {
1888 print
'<td class="center">'.dol_print_date($db->jdate($obj->dsignature),
'day');
1891 print
'<td> </td>';
1894 $totalarray[
'nbfield']++;
1898 if (!empty($arrayfields[
'ava.rowid'][
'checked'])) {
1899 print
'<td class="center">';
1900 $form->form_availability(
'', $obj->availability,
'none', 1);
1903 $totalarray[
'nbfield']++;
1907 if (!empty($arrayfields[
'p.fk_shipping_method'][
'checked'])) {
1909 $form->formSelectShippingMethod(
'', $obj->fk_shipping_method,
'none', 1);
1912 $totalarray[
'nbfield']++;
1916 if (!empty($arrayfields[
'p.fk_input_reason'][
'checked'])) {
1917 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag(
$form->cache_demand_reason[$obj->fk_input_reason][
'label']).
'">';
1918 if ($obj->fk_input_reason > 0) {
1919 print
$form->cache_demand_reason[$obj->fk_input_reason][
'label'];
1923 $totalarray[
'nbfield']++;
1927 if (!empty($arrayfields[
'p.fk_cond_reglement'][
'checked'])) {
1929 $form->form_conditions_reglement($_SERVER[
'PHP_SELF'], $obj->fk_cond_reglement,
'none', 0,
'', 1, $obj->deposit_percent);
1932 $totalarray[
'nbfield']++;
1936 if (!empty($arrayfields[
'p.fk_mode_reglement'][
'checked'])) {
1938 $form->form_modes_reglement($_SERVER[
'PHP_SELF'], $obj->fk_mode_reglement,
'none',
'', -1);
1941 $totalarray[
'nbfield']++;
1945 if (!empty($arrayfields[
'p.total_ht'][
'checked'])) {
1946 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ht).
"</span></td>\n";
1948 $totalarray[
'nbfield']++;
1951 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.total_ht';
1953 if (empty($totalarray[
'val'][
'p.total_ht'])) {
1954 $totalarray[
'val'][
'p.total_ht'] = $obj->total_ht;
1956 $totalarray[
'val'][
'p.total_ht'] += $obj->total_ht;
1960 if (!empty($arrayfields[
'p.total_tva'][
'checked'])) {
1961 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_tva).
"</span></td>\n";
1963 $totalarray[
'nbfield']++;
1966 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.total_tva';
1968 if (empty($totalarray[
'val'][
'p.total_tva'])) {
1969 $totalarray[
'val'][
'p.total_tva'] = $obj->total_tva;
1971 $totalarray[
'val'][
'p.total_tva'] += $obj->total_tva;
1975 if (!empty($arrayfields[
'p.total_ttc'][
'checked'])) {
1976 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
"</span></td>\n";
1978 $totalarray[
'nbfield']++;
1981 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.total_ttc';
1983 if (empty($totalarray[
'val'][
'p.total_ttc'])) {
1984 $totalarray[
'val'][
'p.total_ttc'] = $obj->total_ttc;
1986 $totalarray[
'val'][
'p.total_ttc'] += $obj->total_ttc;
1990 if (!empty($arrayfields[
'p.total_ht_invoiced'][
'checked'])) {
1991 print
'<td class="nowrap right"><span class="amount">'.price($totalInvoicedHT).
"</span></td>\n";
1993 $totalarray[
'nbfield']++;
1996 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.total_ht_invoiced';
1998 if (empty($totalarray[
'val'][
'p.total_ht_invoiced'])) {
1999 $totalarray[
'val'][
'p.total_ht_invoiced'] = $totalInvoicedHT;
2001 $totalarray[
'val'][
'p.total_ht_invoiced'] += $totalInvoicedHT;
2005 if (!empty($arrayfields[
'p.total_invoiced'][
'checked'])) {
2006 print
'<td class="nowrap right"><span class="amount">'.price($totalInvoicedTTC).
"</span></td>\n";
2008 $totalarray[
'nbfield']++;
2011 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.total_invoiced';
2013 if (empty($totalarray[
'val'][
'p.total_invoiced'])) {
2014 $totalarray[
'val'][
'p.total_invoiced'] = $totalInvoicedTTC;
2016 $totalarray[
'val'][
'p.total_invoiced'] += $totalInvoicedTTC;
2020 if (!empty($arrayfields[
'p.multicurrency_code'][
'checked'])) {
2021 print
'<td class="nowrap">'.$obj->multicurrency_code.
' - '.$langs->trans(
'Currency'.$obj->multicurrency_code).
"</td>\n";
2023 $totalarray[
'nbfield']++;
2028 if (!empty($arrayfields[
'p.multicurrency_tx'][
'checked'])) {
2029 print
'<td class="nowrap">';
2030 $form->form_multicurrency_rate($_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid, $obj->multicurrency_tx,
'none', $obj->multicurrency_code);
2033 $totalarray[
'nbfield']++;
2037 if (!empty($arrayfields[
'p.multicurrency_total_ht'][
'checked'])) {
2038 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht).
"</span></td>\n";
2040 $totalarray[
'nbfield']++;
2044 if (!empty($arrayfields[
'p.multicurrency_total_tva'][
'checked'])) {
2045 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_tva).
"</span></td>\n";
2047 $totalarray[
'nbfield']++;
2051 if (!empty($arrayfields[
'p.multicurrency_total_ttc'][
'checked'])) {
2052 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc).
"</span></td>\n";
2054 $totalarray[
'nbfield']++;
2058 if (!empty($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'checked'])) {
2059 print
'<td class="nowrap right"><span class="amount">'.price($multicurrency_totalInvoicedHT).
"</span></td>\n";
2061 $totalarray[
'nbfield']++;
2065 if (!empty($arrayfields[
'p.multicurrency_total_invoiced'][
'checked'])) {
2066 print
'<td class="nowrap right"><span class="amount">'.price($multicurrency_totalInvoicedTTC).
"</span></td>\n";
2068 $totalarray[
'nbfield']++;
2072 $userstatic->id = $obj->fk_user_author;
2073 $userstatic->login = $obj->login;
2074 $userstatic->lastname = $obj->lastname;
2075 $userstatic->firstname = $obj->firstname;
2076 $userstatic->email = $obj->user_email;
2077 $userstatic->statut = $obj->user_statut;
2078 $userstatic->entity = $obj->user_entity;
2079 $userstatic->photo = $obj->photo;
2080 $userstatic->office_phone = $obj->office_phone;
2081 $userstatic->office_fax = $obj->office_fax;
2082 $userstatic->user_mobile = $obj->user_mobile;
2083 $userstatic->job = $obj->job;
2084 $userstatic->gender = $obj->gender;
2087 if (!empty($arrayfields[
'u.login'][
'checked'])) {
2088 print
'<td class="tdoverflowmax150">';
2089 if ($userstatic->id) {
2090 print $userstatic->getNomUrl(-1);
2094 $totalarray[
'nbfield']++;
2098 if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
2100 print
'<td class="tdoverflowmax150">';
2101 if ($obj->socid > 0) {
2102 $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
2103 if ($listsalesrepresentatives < 0) {
2106 $nbofsalesrepresentative = count($listsalesrepresentatives);
2107 if ($nbofsalesrepresentative > 6) {
2109 print $nbofsalesrepresentative;
2110 } elseif ($nbofsalesrepresentative > 0) {
2111 $userstatic =
new User($db);
2113 foreach ($listsalesrepresentatives as $val) {
2114 $userstatic->id = $val[
'id'];
2115 $userstatic->lastname = $val[
'lastname'];
2116 $userstatic->firstname = $val[
'firstname'];
2117 $userstatic->email = $val[
'email'];
2118 $userstatic->statut = $val[
'statut'];
2119 $userstatic->entity = $val[
'entity'];
2120 $userstatic->photo = $val[
'photo'];
2121 $userstatic->login = $val[
'login'];
2122 $userstatic->office_phone = $val[
'office_phone'];
2123 $userstatic->office_fax = $val[
'office_fax'];
2124 $userstatic->user_mobile = $val[
'user_mobile'];
2125 $userstatic->job = $val[
'job'];
2126 $userstatic->gender = $val[
'gender'];
2128 print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1,
'', 0, 0, 12) : $userstatic->getNomUrl(-2);
2130 if ($j < $nbofsalesrepresentative) {
2142 $totalarray[
'nbfield']++;
2147 if (!empty($arrayfields[
'total_pa'][
'checked'])) {
2148 print
'<td class="right nowrap">'.price($marginInfo[
'pa_total']).
'</td>';
2150 $totalarray[
'nbfield']++;
2154 if (!empty($arrayfields[
'total_margin'][
'checked'])) {
2155 print
'<td class="right nowrap">'.price($marginInfo[
'total_margin']).
'</td>';
2157 $totalarray[
'nbfield']++;
2160 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_margin';
2162 $totalarray[
'val'][
'total_margin'] = $total_margin;
2165 if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
2166 print
'<td class="right nowrap">'.(($marginInfo[
'total_margin_rate'] ==
'') ?
'' :
price($marginInfo[
'total_margin_rate'],
null,
null,
null,
null, 2).
'%').
'</td>';
2168 $totalarray[
'nbfield']++;
2172 if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
2173 print
'<td class="right nowrap">'.(($marginInfo[
'total_mark_rate'] ==
'') ?
'' :
price($marginInfo[
'total_mark_rate'],
null,
null,
null,
null, 2).
'%').
'</td>';
2175 $totalarray[
'nbfield']++;
2178 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_mark_rate';
2180 if ($i >= $imaxinloop - 1) {
2181 if (!empty($total_ht)) {
2182 $totalarray[
'val'][
'total_mark_rate'] =
price2num($total_margin * 100 / $total_ht,
'MT');
2184 $totalarray[
'val'][
'total_mark_rate'] =
'';
2190 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
2192 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
2193 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
2194 print $hookmanager->resPrint;
2196 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
2197 print
'<td align="center" class="nowrap">';
2198 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
2201 $totalarray[
'nbfield']++;
2205 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
2206 print
'<td align="center" class="nowrap">';
2207 print
dol_print_date($db->jdate($obj->date_update),
'dayhour',
'tzuser');
2210 $totalarray[
'nbfield']++;
2214 if (!empty($arrayfields[
'p.date_cloture'][
'checked'])) {
2215 print
'<td align="center" class="nowrap">';
2216 print
dol_print_date($db->jdate($obj->date_cloture),
'dayhour',
'tzuser');
2219 $totalarray[
'nbfield']++;
2223 if (!empty($arrayfields[
'p.note_public'][
'checked'])) {
2224 print
'<td class="center">';
2228 $totalarray[
'nbfield']++;
2232 if (!empty($arrayfields[
'p.note_private'][
'checked'])) {
2233 print
'<td class="center">';
2237 $totalarray[
'nbfield']++;
2241 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
2242 print
'<td class="nowrap right">'.$objectstatic->getLibStatut(5).
'</td>';
2244 $totalarray[
'nbfield']++;
2248 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
2249 print
'<td class="nowrap" align="center">';
2250 if ($massactionbutton || $massaction) {
2252 if (in_array($obj->rowid, $arrayofselected)) {
2255 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2259 $totalarray[
'nbfield']++;
2270 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
2275 foreach ($arrayfields as $key => $val) {
2276 if (!empty($val[
'checked'])) {
2280 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2285 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
2286 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
2287 print $hookmanager->resPrint;
2289 print
'</table>'.
"\n";
2290 print
'</div>'.
"\n";
2292 print
'</form>'.
"\n";
2294 $hidegeneratedfilelistifempty = 1;
2295 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
2296 $hidegeneratedfilelistifempty = 0;
2300 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
2301 $urlsource .= str_replace(
'&',
'&', $param);
2303 $filedir = $diroutputmassaction;
2304 $genallowed = $user->rights->propal->lire;
2305 $delallowed = $user->rights->propal->creer;
2307 print $formfile->showdocuments(
'massfilesarea_proposals',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);