Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
89a62a2c43
@ -2249,15 +2249,15 @@ class Contrat extends CommonObject
|
||||
$warning_delay = $conf->contrat->services->inactifs->warning_delay;
|
||||
$label = $langs->trans("BoardNotActivatedServices");
|
||||
$labelShort = $langs->trans("BoardNotActivatedServicesShort");
|
||||
$url = DOL_URL_ROOT.'/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&mode=0&sortfield=cd.date_fin_validite&sortorder=asc';
|
||||
$url = DOL_URL_ROOT.'/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=0&sortfield=cd.date_fin_validite&sortorder=asc';
|
||||
} elseif ($mode == 'expired') {
|
||||
$warning_delay = $conf->contrat->services->expires->warning_delay;
|
||||
$url = DOL_URL_ROOT.'/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&mode=4&filter=expired&sortfield=cd.date_fin_validite&sortorder=asc';
|
||||
$url = DOL_URL_ROOT.'/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=4&filter=expired&sortfield=cd.date_fin_validite&sortorder=asc';
|
||||
$label = $langs->trans("BoardExpiredServices");
|
||||
$labelShort = $langs->trans("BoardExpiredServicesShort");
|
||||
} else {
|
||||
$warning_delay = $conf->contrat->services->expires->warning_delay;
|
||||
$url = DOL_URL_ROOT.'/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&mode=4&sortfield=cd.date_fin_validite&sortorder=asc';
|
||||
$url = DOL_URL_ROOT.'/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=4&sortfield=cd.date_fin_validite&sortorder=asc';
|
||||
//$url.= '&op2day='.$arraydatetouse['mday'].'&op2month='.$arraydatetouse['mon'].'&op2year='.$arraydatetouse['year'];
|
||||
//if ($warning_delay >= 0) $url.='&filter=expired';
|
||||
$label = $langs->trans("BoardRunningServices");
|
||||
|
||||
@ -194,7 +194,7 @@ foreach ($listofstatus as $status) {
|
||||
if (empty($conf->use_javascript_ajax)) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$staticcontratligne->LibStatut($status, 0, ($bool ? 1 : 0)).'</td>';
|
||||
print '<td class="right"><a href="services_list.php?mode='.$status.($bool ? '&filter=expired' : '').'">'.($nb[$status.$bool] ? $nb[$status.$bool] : 0).' '.$staticcontratligne->LibStatut($status, 3, ($bool ? 1 : 0)).'</a></td>';
|
||||
print '<td class="right"><a href="services_list.php?search_status='.((int) $status).($bool ? '&filter=expired' : '').'">'.($nb[$status.$bool] ? $nb[$status.$bool] : 0).' '.$staticcontratligne->LibStatut($status, 3, ($bool ? 1 : 0)).'</a></td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
if ($status == 4 && !$bool) {
|
||||
@ -224,7 +224,7 @@ foreach ($listofstatus as $status) {
|
||||
if (empty($conf->use_javascript_ajax)) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$staticcontratligne->LibStatut($status, 0, ($bool ? 1 : 0)).'</td>';
|
||||
print '<td class="right"><a href="services_list.php?mode='.$status.($bool ? '&filter=expired' : '').'">'.($nb[$status.$bool] ? $nb[$status.$bool] : 0).' '.$staticcontratligne->LibStatut($status, 3, ($bool ? 1 : 0)).'</a></td>';
|
||||
print '<td class="right"><a href="services_list.php?search_status='.((int) $status).($bool ? '&filter=expired' : '').'">'.($nb[$status.$bool] ? $nb[$status.$bool] : 0).' '.$staticcontratligne->LibStatut($status, 3, ($bool ? 1 : 0)).'</a></td>';
|
||||
if ($status == 4 && !$bool) {
|
||||
$bool = true;
|
||||
} else {
|
||||
@ -622,7 +622,7 @@ if ($resql) {
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre"><th colspan="4">'.$langs->trans("ListOfExpiredServices").' <a href="'.DOL_URL_ROOT.'/contrat/services_list.php?mode=4&filter=expired"><span class="badge">'.$num.'</span></a></th>';
|
||||
print '<tr class="liste_titre"><th colspan="4">'.$langs->trans("ListOfExpiredServices").' <a href="'.DOL_URL_ROOT.'/contrat/services_list.php?search_status=4&filter=expired"><span class="badge">'.$num.'</span></a></th>';
|
||||
print "</tr>\n";
|
||||
|
||||
while ($i < $num) {
|
||||
|
||||
@ -36,6 +36,7 @@ require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
|
||||
$langs->loadLangs(array('products', 'contracts', 'companies'));
|
||||
|
||||
$optioncss = GETPOST('optioncss', 'aZ09');
|
||||
$mode = GETPOST("mode");
|
||||
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -55,11 +56,10 @@ if (!$sortorder) {
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
|
||||
$mode = GETPOST("mode");
|
||||
$filter = GETPOST("filter");
|
||||
$filter = GETPOST("filter", 'alpha');
|
||||
$search_name = GETPOST("search_name", 'alpha');
|
||||
$search_subprice = GETPOST("search_subprice", 'alpha');
|
||||
$search_qty = GETPOST("search_name", 'alpha');
|
||||
$search_qty = GETPOST("search_qty", 'alpha');
|
||||
$search_total_ht = GETPOST("search_total_ht", 'alpha');
|
||||
$search_total_tva = GETPOST("search_total_tva", 'alpha');
|
||||
$search_total_ttc = GETPOST("search_total_ttc", 'alpha');
|
||||
@ -110,7 +110,6 @@ $result = restrictedArea($user, 'contrat', $contratid);
|
||||
|
||||
if ($search_status != '') {
|
||||
$tmp = explode('&', $search_status);
|
||||
$mode = $tmp[0];
|
||||
if (empty($tmp[1])) {
|
||||
$filter = '';
|
||||
} else {
|
||||
@ -121,14 +120,6 @@ if ($search_status != '') {
|
||||
$filter = 'expired';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$search_status = $mode;
|
||||
if ($filter == 'expired') {
|
||||
$search_status .= '&filter=expired';
|
||||
}
|
||||
if ($filter == 'notexpired') {
|
||||
$search_status .= '&filter=notexpired';
|
||||
}
|
||||
}
|
||||
|
||||
$staticcontrat = new Contrat($db);
|
||||
@ -144,10 +135,10 @@ $arrayfields = array(
|
||||
'cd.qty'=>array('label'=>"Qty", 'checked'=>1, 'position'=>108),
|
||||
'cd.total_ht'=>array('label'=>"TotalHT", 'checked'=>-1, 'position'=>109, 'isameasure'=>1),
|
||||
'cd.total_tva'=>array('label'=>"TotalVAT", 'checked'=>-1, 'position'=>110),
|
||||
'cd.date_ouverture_prevue'=>array('label'=>"DateStartPlannedShort", 'checked'=>(($mode == "" || $mode == -1) || $mode == "0"), 'position'=>150),
|
||||
'cd.date_ouverture'=>array('label'=>"DateStartRealShort", 'checked'=>(($mode == "" || $mode == -1) || $mode > 0), 'position'=>160),
|
||||
'cd.date_fin_validite'=>array('label'=>"DateEndPlannedShort", 'checked'=>(($mode == "" || $mode == -1) || $mode < 5), 'position'=>170),
|
||||
'cd.date_cloture'=>array('label'=>"DateEndRealShort", 'checked'=>(($mode == "" || $mode == -1) || $mode >= 5), 'position'=>180),
|
||||
'cd.date_ouverture_prevue'=>array('label'=>"DateStartPlannedShort", 'checked'=>1, 'position'=>150),
|
||||
'cd.date_ouverture'=>array('label'=>"DateStartRealShort", 'checked'=>1, 'position'=>160),
|
||||
'cd.date_fin_validite'=>array('label'=>"DateEndPlannedShort", 'checked'=>1, 'position'=>170),
|
||||
'cd.date_cloture'=>array('label'=>"DateEndRealShort", 'checked'=>1, 'position'=>180),
|
||||
//'cd.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
||||
'cd.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
|
||||
'status'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000)
|
||||
@ -209,7 +200,6 @@ if (empty($reshook)) {
|
||||
$opclotureday = "";
|
||||
$opclotureyear = "";
|
||||
$filter_opcloture = "";
|
||||
$mode = '';
|
||||
$filter = '';
|
||||
$toselect = array();
|
||||
$search_array_options = array();
|
||||
@ -275,13 +265,13 @@ $sql .= " AND c.fk_soc = s.rowid";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($mode == "0") {
|
||||
if ($search_status == "0") {
|
||||
$sql .= " AND cd.statut = 0";
|
||||
}
|
||||
if ($mode == "4") {
|
||||
if ($search_status == "4") {
|
||||
$sql .= " AND cd.statut = 4";
|
||||
}
|
||||
if ($mode == "5") {
|
||||
if ($search_status == "5") {
|
||||
$sql .= " AND cd.statut = 5";
|
||||
}
|
||||
if ($filter == "expired") {
|
||||
@ -294,7 +284,7 @@ if ($search_subprice) {
|
||||
$sql .= natural_search("cd.subprice", $search_subprice, 1);
|
||||
}
|
||||
if ($search_qty) {
|
||||
$sql .= natural_search("cd.total_qty", $search_qty, 1);
|
||||
$sql .= natural_search("cd.qty", $search_qty, 1);
|
||||
}
|
||||
if ($search_total_ht) {
|
||||
$sql .= natural_search("cd.total_ht", $search_total_ht, 1);
|
||||
@ -417,6 +407,9 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.$limit;
|
||||
}
|
||||
if ($mode) {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
}
|
||||
if ($search_contract) {
|
||||
$param .= '&search_contract='.urlencode($search_contract);
|
||||
}
|
||||
@ -441,8 +434,8 @@ if ($search_total_ttc) {
|
||||
if ($search_service) {
|
||||
$param .= '&search_service='.urlencode($search_service);
|
||||
}
|
||||
if ($mode) {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
if ($search_status) {
|
||||
$param .= '&search_status='.urlencode($search_status);
|
||||
}
|
||||
if ($filter) {
|
||||
$param .= '&filter='.urlencode($filter);
|
||||
@ -500,16 +493,16 @@ print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
$title = $langs->trans("ListOfServices");
|
||||
if ($mode == "0") {
|
||||
if ($search_status == "0") {
|
||||
$title = $langs->trans("ListOfInactiveServices"); // Must use == "0"
|
||||
}
|
||||
if ($mode == "4" && $filter != "expired") {
|
||||
if ($search_status == "4" && $filter != "expired") {
|
||||
$title = $langs->trans("ListOfRunningServices");
|
||||
}
|
||||
if ($mode == "4" && $filter == "expired") {
|
||||
if ($search_status == "4" && $filter == "expired") {
|
||||
$title = $langs->trans("ListOfExpiredServices");
|
||||
}
|
||||
if ($mode == "5") {
|
||||
if ($search_status == "5") {
|
||||
$title = $langs->trans("ListOfClosedServices");
|
||||
}
|
||||
|
||||
@ -563,7 +556,7 @@ if (!empty($arrayfields['c.ref']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="hidden" name="filter" value="'.$filter.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
print '<input type="text" class="flat" size="3" name="search_contract" value="'.dol_escape_htmltag($search_contract).'">';
|
||||
print '<input type="text" class="flat maxwidth75" name="search_contract" value="'.dol_escape_htmltag($search_contract).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Service label
|
||||
@ -964,6 +957,17 @@ while ($i < min($num, $limit)) {
|
||||
// Show total line
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
||||
|
||||
// If no record found
|
||||
if ($num == 0) {
|
||||
$colspan = 1;
|
||||
foreach ($arrayfields as $key => $val) {
|
||||
if (!empty($val['checked'])) {
|
||||
$colspan++;
|
||||
}
|
||||
}
|
||||
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
|
||||
$parameters = array('sql' => $sql);
|
||||
|
||||
@ -205,10 +205,10 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1401__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/card.php?mainmenu=commercial&action=create&leftmenu=contracts', 'NewContract', 1, 'contracts', '$user->rights->contrat->creer', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1402__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/list.php?mainmenu=commercial&leftmenu=contracts', 'List', 1, 'contracts', '$user->rights->contrat->lire', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1403__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts', 'MenuServices', 1, 'contracts', '$user->rights->contrat->lire', '', 2, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1404__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&mode=0', 'MenuInactiveServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1405__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&mode=4', 'MenuRunningServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1406__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&mode=4&filter=expired', 'MenuExpiredServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1407__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&mode=5', 'MenuClosedServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 3, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1404__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=0', 'MenuInactiveServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1405__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=4', 'MenuRunningServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1406__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=4&filter=expired', 'MenuExpiredServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1407__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=5', 'MenuClosedServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 3, __ENTITY__);
|
||||
|
||||
-- Commercial - Interventions
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->ficheinter->enabled', __HANDLER__, 'left', 1500__+MAX_llx_menu__, 'commercial', 'ficheinter', 5__+MAX_llx_menu__, '/fichinter/list.php?mainmenu=commercial&leftmenu=ficheinter', 'Interventions', 0, 'interventions', '$user->rights->ficheinter->lire', '', 2, 8, __ENTITY__);
|
||||
|
||||
@ -1385,10 +1385,10 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left
|
||||
$newmenu->add("/contrat/list.php?leftmenu=contracts", $langs->trans("List"), 1, $user->hasRight('contrat', 'lire'));
|
||||
$newmenu->add("/contrat/services_list.php?leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->hasRight('contrat', 'lire'));
|
||||
if ($usemenuhider || empty($leftmenu) || $leftmenu == "contracts") {
|
||||
$newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=0", $langs->trans("MenuInactiveServices"), 2, $user->hasRight('contrat', 'lire'));
|
||||
$newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=4", $langs->trans("MenuRunningServices"), 2, $user->hasRight('contrat', 'lire'));
|
||||
$newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=4&filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->hasRight('contrat', 'lire'));
|
||||
$newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=5", $langs->trans("MenuClosedServices"), 2, $user->hasRight('contrat', 'lire'));
|
||||
$newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=0", $langs->trans("MenuInactiveServices"), 2, $user->hasRight('contrat', 'lire'));
|
||||
$newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=4", $langs->trans("MenuRunningServices"), 2, $user->hasRight('contrat', 'lire'));
|
||||
$newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=4&filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->hasRight('contrat', 'lire'));
|
||||
$newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=5", $langs->trans("MenuClosedServices"), 2, $user->hasRight('contrat', 'lire'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user