NEW Send by email available in bulk for expense report
This commit is contained in:
parent
b4eab24490
commit
e014ac6ea9
@ -114,11 +114,11 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Mass actions
|
// Mass actions
|
||||||
$objectclass='Skeleton';
|
$objectclass='ExpenseReport';
|
||||||
$objectlabel='Skeleton';
|
$objectlabel='ExpenseReport';
|
||||||
$permtoread = $user->rights->accounting->read;
|
$permtoread = $user->rights->expensereport->read;
|
||||||
$permtodelete = $user->rights->accounting->delete;
|
$permtodelete = $user->rights->expensereport->delete;
|
||||||
$uploaddir = $conf->accounting->dir_output;
|
$uploaddir = $conf->expensereport->dir_output;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
|
|
||||||
if ($massaction == 'ventil') {
|
if ($massaction == 'ventil') {
|
||||||
|
|||||||
@ -96,8 +96,8 @@ $pagenext = $page + 1;
|
|||||||
if (! $sortfield) $sortfield='p.ref';
|
if (! $sortfield) $sortfield='p.ref';
|
||||||
if (! $sortorder) $sortorder='DESC';
|
if (! $sortorder) $sortorder='DESC';
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage context to save list fields
|
||||||
$contextpage='proposallist';
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'proposallist';
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$module='propal';
|
$module='propal';
|
||||||
@ -413,6 +413,7 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit);
|
||||||
|
|
||||||
|
|||||||
@ -83,6 +83,7 @@ $result = restrictedArea($user, 'commande', $id,'');
|
|||||||
|
|
||||||
$diroutputmassaction=$conf->commande->dir_output . '/temp/massgeneration/'.$user->id;
|
$diroutputmassaction=$conf->commande->dir_output . '/temp/massgeneration/'.$user->id;
|
||||||
|
|
||||||
|
// Load variable for pagination
|
||||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
@ -206,7 +207,8 @@ if (empty($reshook))
|
|||||||
$permtoread = $user->rights->commande->lire;
|
$permtoread = $user->rights->commande->lire;
|
||||||
$permtodelete = $user->rights->commande->supprimer;
|
$permtodelete = $user->rights->commande->supprimer;
|
||||||
$uploaddir = $conf->commande->dir_output;
|
$uploaddir = $conf->commande->dir_output;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
$trigger_name='ORDER_SENTBYMAIL';
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
|
|
||||||
// TODO Move this into mass action include
|
// TODO Move this into mass action include
|
||||||
if ($massaction == 'confirm_createbills') {
|
if ($massaction == 'confirm_createbills') {
|
||||||
@ -994,8 +996,6 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
|
||||||
|
|
||||||
$notshippable=0;
|
$notshippable=0;
|
||||||
$warning = 0;
|
$warning = 0;
|
||||||
$text_info='';
|
$text_info='';
|
||||||
@ -1018,6 +1018,8 @@ if ($resql)
|
|||||||
$generic_commande->total_tva = $obj->total_tva;
|
$generic_commande->total_tva = $obj->total_tva;
|
||||||
$generic_commande->total_ttc = $obj->total_ttc;
|
$generic_commande->total_ttc = $obj->total_ttc;
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
if (! empty($arrayfields['c.ref']['checked']))
|
if (! empty($arrayfields['c.ref']['checked']))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -110,8 +110,8 @@ if (! $sortfield) $sortfield='f.datef';
|
|||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage context to save list fields
|
||||||
$contextpage='invoicelist';
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'invoicelist';
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$fieldid = (! empty($ref)?'facnumber':'rowid');
|
$fieldid = (! empty($ref)?'facnumber':'rowid');
|
||||||
@ -606,6 +606,7 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||||
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit);
|
print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit);
|
||||||
|
|
||||||
|
|||||||
@ -285,7 +285,7 @@ if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) &&
|
|||||||
llxHeader(null, $langs->trans("Services"));
|
llxHeader(null, $langs->trans("Services"));
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||||
if ($search_contract) $param.='&search_contract='.urlencode($search_contract);
|
if ($search_contract) $param.='&search_contract='.urlencode($search_contract);
|
||||||
if ($search_name) $param.='&search_name='.urlencode($search_name);
|
if ($search_name) $param.='&search_name='.urlencode($search_name);
|
||||||
@ -326,6 +326,7 @@ print '<input type="hidden" name="action" value="list">';
|
|||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
$title=$langs->trans("ListOfServices");
|
$title=$langs->trans("ListOfServices");
|
||||||
if ($mode == "0") $title=$langs->trans("ListOfInactiveServices"); // Must use == "0"
|
if ($mode == "0") $title=$langs->trans("ListOfInactiveServices"); // Must use == "0"
|
||||||
|
|||||||
@ -73,6 +73,8 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$thirdparty=new Societe($db);
|
$thirdparty=new Societe($db);
|
||||||
|
if ($objecttmp->element == 'expensereport') $thirdparty=new User($db);
|
||||||
|
|
||||||
$objecttmp=new $objectclass($db);
|
$objecttmp=new $objectclass($db);
|
||||||
$listofobjectid=array();
|
$listofobjectid=array();
|
||||||
$listofobjectthirdparties=array();
|
$listofobjectthirdparties=array();
|
||||||
@ -86,6 +88,7 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
$listofobjectid[$toselectid]=$toselectid;
|
$listofobjectid[$toselectid]=$toselectid;
|
||||||
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
|
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
|
||||||
if ($objecttmp->element == 'societe') $thirdpartyid=$objecttmp->id;
|
if ($objecttmp->element == 'societe') $thirdpartyid=$objecttmp->id;
|
||||||
|
if ($objecttmp->element == 'expensereport') $thirdpartyid=$objecttmp->fk_user_author;
|
||||||
$listofobjectthirdparties[$thirdpartyid]=$thirdpartyid;
|
$listofobjectthirdparties[$thirdpartyid]=$thirdpartyid;
|
||||||
$listofobjectref[$thirdpartyid][$toselectid]=$objecttmp;
|
$listofobjectref[$thirdpartyid][$toselectid]=$objecttmp;
|
||||||
}
|
}
|
||||||
@ -203,8 +206,17 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
// Test recipient
|
// Test recipient
|
||||||
if (empty($sendto)) // For the case, no recipient were set (multi thirdparties send)
|
if (empty($sendto)) // For the case, no recipient were set (multi thirdparties send)
|
||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
if ($object->element == 'expensereport')
|
||||||
$sendto = $object->thirdparty->email;
|
{
|
||||||
|
$fuser = new User($db);
|
||||||
|
$fuser->fetch($object->fk_user_author);
|
||||||
|
$sendto = $fuser->email;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$object->fetch_thirdparty();
|
||||||
|
$sendto = $object->thirdparty->email;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($sendto))
|
if (empty($sendto))
|
||||||
@ -357,18 +369,32 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
$object->fk_element = $objid;
|
$object->fk_element = $objid;
|
||||||
$object->elementtype = $object->element;
|
$object->elementtype = $object->element;
|
||||||
|
|
||||||
// Appel des triggers
|
$triggername = strtoupper(get_class($object)) .'_SENTBYMAIL';
|
||||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
if ($triggername == 'SOCIETE_SENTBYMAIL') $triggername = 'COMPANY_SENTBYEMAIL';
|
||||||
$interface=new Interfaces($db);
|
if ($triggername == 'CONTRAT_SENTBYMAIL') $triggername = 'CONTRACT_SENTBYEMAIL';
|
||||||
$result=$interface->run_triggers('BILL_SENTBYMAIL',$object,$user,$langs,$conf);
|
if ($triggername == 'COMMANDE_SENTBYMAIL') $triggername = 'ORDER_SENTBYEMAIL';
|
||||||
if ($result < 0) { $error++; $errors=$interface->errors; }
|
if ($triggername == 'FACTURE_SENTBYMAIL') $triggername = 'BILL_SENTBYEMAIL';
|
||||||
// Fin appel triggers
|
if ($triggername == 'EXPEDITION_SENTBYMAIL') $triggername = 'SHIPPING_SENTBYEMAIL';
|
||||||
|
if ($triggername == 'COMMANDEFOURNISSEUR_SENTBYMAIL') $triggername = 'ORDER_SUPPLIER_SENTBYMAIL';
|
||||||
|
if ($triggername == 'FACTUREFOURNISSEUR_SENTBYMAIL') $triggername = 'BILL_SUPPLIER_SENTBYEMAIL';
|
||||||
|
if ($triggername == 'SUPPLIERPROPOSAL_SENTBYMAIL') $triggername = 'PROPOSAL_SUPPLIER_SENTBYEMAIL';
|
||||||
|
|
||||||
if ($error)
|
if (! empty($trigger_name))
|
||||||
{
|
{
|
||||||
setEventMessages($db->lasterror(), $errors, 'errors');
|
// Appel des triggers
|
||||||
dol_syslog("Error in trigger BILL_SENTBYMAIL ".$db->lasterror(), LOG_ERR);
|
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||||
|
$interface=new Interfaces($db);
|
||||||
|
$result=$interface->run_triggers($trigger_name, $object, $user, $langs, $conf);
|
||||||
|
if ($result < 0) { $error++; $errors=$interface->errors; }
|
||||||
|
// Fin appel triggers
|
||||||
|
|
||||||
|
if ($error)
|
||||||
|
{
|
||||||
|
setEventMessages($db->lasterror(), $errors, 'errors');
|
||||||
|
dol_syslog("Error in trigger ".$trigger_name.' '.$db->lasterror(), LOG_ERR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$nbsent++;
|
$nbsent++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,6 +42,8 @@ if (! GETPOST('cancel', 'alpha'))
|
|||||||
$thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid);
|
$thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid);
|
||||||
if ($objecttmp->element == 'societe')
|
if ($objecttmp->element == 'societe')
|
||||||
$thirdpartyid = $objecttmp->id;
|
$thirdpartyid = $objecttmp->id;
|
||||||
|
if ($objecttmp->element == 'expensereport')
|
||||||
|
$thirdpartyid = $objecttmp->fk_user_author;
|
||||||
$listofselectedthirdparties[$thirdpartyid] = $thirdpartyid;
|
$listofselectedthirdparties[$thirdpartyid] = $thirdpartyid;
|
||||||
$listofselectedref[$thirdpartyid][$toselectid] = $objecttmp->ref;
|
$listofselectedref[$thirdpartyid][$toselectid] = $objecttmp->ref;
|
||||||
}
|
}
|
||||||
@ -80,10 +82,19 @@ if (count($listofselectedthirdparties) == 1) // Only 1 different recipient selec
|
|||||||
{
|
{
|
||||||
$liste = array();
|
$liste = array();
|
||||||
$thirdpartyid = array_shift($listofselectedthirdparties);
|
$thirdpartyid = array_shift($listofselectedthirdparties);
|
||||||
$soc = new Societe($db);
|
if ($objecttmp->element == 'expensereport')
|
||||||
$soc->fetch($thirdpartyid);
|
{
|
||||||
foreach ($soc->thirdparty_and_contact_email_array(1) as $key => $value) {
|
$fuser = new User($db);
|
||||||
$liste[$key] = $value;
|
$fuser->fetch($thirdpartyid);
|
||||||
|
$liste['thirdparty'] = $fuser->getFullName($langs)." <".$fuser->email.">";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$soc = new Societe($db);
|
||||||
|
$soc->fetch($thirdpartyid);
|
||||||
|
foreach ($soc->thirdparty_and_contact_email_array(1) as $key => $value) {
|
||||||
|
$liste[$key] = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$formmail->withtoreadonly = 0;
|
$formmail->withtoreadonly = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -36,14 +36,14 @@ $langs->load("companies");
|
|||||||
$langs->load("users");
|
$langs->load("users");
|
||||||
$langs->load("trips");
|
$langs->load("trips");
|
||||||
|
|
||||||
$action=GETPOST('action','alpha');
|
$action=GETPOST('action','aZ09');
|
||||||
$massaction=GETPOST('massaction','alpha');
|
$massaction=GETPOST('massaction','alpha');
|
||||||
$show_files=GETPOST('show_files','int');
|
$show_files=GETPOST('show_files','int');
|
||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = $_GET["socid"]?$_GET["socid"]:'';
|
$socid = GETPOST('socid','int');
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result = restrictedArea($user, 'expensereport','','');
|
$result = restrictedArea($user, 'expensereport','','');
|
||||||
|
|
||||||
@ -79,8 +79,8 @@ $optioncss = GETPOST('optioncss','alpha');
|
|||||||
if ($search_status == '') $search_status=-1;
|
if ($search_status == '') $search_status=-1;
|
||||||
if ($search_user == '') $search_user=-1;
|
if ($search_user == '') $search_user=-1;
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage context to save list fields
|
||||||
$contextpage='expensereportlist';
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'expensereportlist';
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('expensereportlist'));
|
$hookmanager->initHooks(array('expensereportlist'));
|
||||||
@ -139,25 +139,31 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
|||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||||
|
|
||||||
// Purge search criteria
|
|
||||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test must be present to be compatible with all browsers
|
|
||||||
{
|
|
||||||
$search_ref="";
|
|
||||||
$search_user="";
|
|
||||||
$search_amount_ht="";
|
|
||||||
$search_amount_vat="";
|
|
||||||
$search_amount_ttc="";
|
|
||||||
$search_status="";
|
|
||||||
$month_start="";
|
|
||||||
$year_start="";
|
|
||||||
$month_end="";
|
|
||||||
$year_end="";
|
|
||||||
$toselect='';
|
|
||||||
$search_array_options=array();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
|
// Purge search criteria
|
||||||
|
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test must be present to be compatible with all browsers
|
||||||
|
{
|
||||||
|
$search_ref="";
|
||||||
|
$search_user="";
|
||||||
|
$search_amount_ht="";
|
||||||
|
$search_amount_vat="";
|
||||||
|
$search_amount_ttc="";
|
||||||
|
$search_status="";
|
||||||
|
$month_start="";
|
||||||
|
$year_start="";
|
||||||
|
$month_end="";
|
||||||
|
$year_end="";
|
||||||
|
$toselect='';
|
||||||
|
$search_array_options=array();
|
||||||
|
}
|
||||||
|
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')
|
||||||
|
|| GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha'))
|
||||||
|
{
|
||||||
|
$massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mass actions
|
||||||
$objectclass='ExpenseReport';
|
$objectclass='ExpenseReport';
|
||||||
$objectlabel='ExpenseReport';
|
$objectlabel='ExpenseReport';
|
||||||
$permtoread = $user->rights->expensereport->lire;
|
$permtoread = $user->rights->expensereport->lire;
|
||||||
@ -167,7 +173,6 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -176,7 +181,8 @@ $form = new Form($db);
|
|||||||
$formother = new FormOther($db);
|
$formother = new FormOther($db);
|
||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
|
|
||||||
llxHeader('', $langs->trans("ListOfTrips"));
|
$title = $langs->trans("ListOfTrips");
|
||||||
|
llxHeader('', $title);
|
||||||
|
|
||||||
$max_year = 5;
|
$max_year = 5;
|
||||||
$min_year = 5;
|
$min_year = 5;
|
||||||
@ -184,7 +190,7 @@ $min_year = 5;
|
|||||||
|
|
||||||
$sql = "SELECT d.rowid, d.ref, d.fk_user_author, d.total_ht, d.total_tva, d.total_ttc, d.fk_statut as status,";
|
$sql = "SELECT d.rowid, d.ref, d.fk_user_author, d.total_ht, d.total_tva, d.total_ttc, d.fk_statut as status,";
|
||||||
$sql.= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve, d.note_private, d.note_public,";
|
$sql.= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve, d.note_private, d.note_public,";
|
||||||
$sql.= " u.rowid as id_user, u.firstname, u.lastname, u.login, u.statut, u.photo";
|
$sql.= " u.rowid as id_user, u.firstname, u.lastname, u.login, u.email, u.statut, u.photo";
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
@ -267,6 +273,7 @@ $sql.=$hookmanager->resPrint;
|
|||||||
|
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
|
// Count total nb of records
|
||||||
$nbtotalofrecords = '';
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
@ -276,14 +283,14 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
|||||||
$sql.= $db->plimit($limit+1, $offset);
|
$sql.= $db->plimit($limit+1, $offset);
|
||||||
|
|
||||||
//print $sql;
|
//print $sql;
|
||||||
$resql=$db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||||
|
|
||||||
$param="";
|
$param='';
|
||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||||
if ($sall) $param.="&sall=".$sall;
|
if ($sall) $param.="&sall=".$sall;
|
||||||
@ -303,20 +310,22 @@ if ($resql)
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
'presend'=>$langs->trans("SendByMail"),
|
||||||
'builddoc'=>$langs->trans("PDFMerge"),
|
'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
if ($user->rights->expensereport->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
|
if ($user->rights->expensereport->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
|
||||||
if ($massaction == 'presend') $arrayofmassactions=array();
|
if ($massaction == 'presend') $arrayofmassactions=array();
|
||||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
// Lines of title fields
|
||||||
|
print '<form id="searchFormList" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="action" value="list">';
|
print '<input type="hidden" name="action" value="list">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
$title = $langs->trans("ListTripsAndExpenses");
|
$title = $langs->trans("ListTripsAndExpenses");
|
||||||
@ -324,9 +333,9 @@ if ($resql)
|
|||||||
|
|
||||||
if ($massaction == 'presend')
|
if ($massaction == 'presend')
|
||||||
{
|
{
|
||||||
$topicmail="SendInterventionRef";
|
$topicmail="SendExpenseReport";
|
||||||
$modelmail="fichinter_send";
|
$modelmail="expensereport";
|
||||||
$objecttmp=new Intervention($db);
|
$objecttmp=new ExpenseReport($db);
|
||||||
$trackid='int'.$object->id;
|
$trackid='int'.$object->id;
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_form.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_form.tpl.php';
|
||||||
@ -580,6 +589,7 @@ if ($resql)
|
|||||||
$usertmp->login=$obj->login;
|
$usertmp->login=$obj->login;
|
||||||
$usertmp->statut=$obj->statut;
|
$usertmp->statut=$obj->statut;
|
||||||
$usertmp->photo=$obj->photo;
|
$usertmp->photo=$obj->photo;
|
||||||
|
$usertmp->email=$obj->email;
|
||||||
print $usertmp->getNomUrl(-1);
|
print $usertmp->getNomUrl(-1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|||||||
@ -119,8 +119,8 @@ $pagenext = $page + 1;
|
|||||||
if (! $sortorder) $sortorder="DESC";
|
if (! $sortorder) $sortorder="DESC";
|
||||||
if (! $sortfield) $sortfield="f.datef,f.rowid";
|
if (! $sortfield) $sortfield="f.datef,f.rowid";
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage context to save list fields
|
||||||
$contextpage='supplierinvoicelist';
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'supplierinvoicelist';
|
||||||
|
|
||||||
$diroutputmassaction=$conf->fournisseur->facture->dir_output . '/temp/massgeneration/'.$user->id;
|
$diroutputmassaction=$conf->fournisseur->facture->dir_output . '/temp/massgeneration/'.$user->id;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user