diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 4ee029ee8e836ed04143a948962264091b962f31..4668c6a56a48069fece183b97ef47afb1c87a17f 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1739,7 +1739,7 @@ if ($action == 'create') // Proposal card - $linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; + $linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; $morehtmlref='<div class="refidno">'; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index d7f2411f615c1cc2b3d4683deb692cf22f5a0842..a59fefc7a8920e1864fa2b1fc0d15a0178ed7bda 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -254,7 +254,7 @@ class Propal extends CommonObject $tva_npr = get_default_npr($mysoc,$this->thirdparty,$prod->id); if (empty($tva_tx)) $tva_npr=0; $vat_src_code = ''; // May be defined into tva_tx - + $localtax1_tx = get_localtax($tva_tx,1,$mysoc,$this->thirdparty,$tva_npr); $localtax2_tx = get_localtax($tva_tx,2,$mysoc,$this->thirdparty,$tva_npr); @@ -433,7 +433,7 @@ class Propal extends CommonObject // Check parameters if ($type < 0) return -1; - + if ($this->statut == self::STATUS_DRAFT) { $this->db->begin(); @@ -1392,17 +1392,17 @@ class Propal extends CommonObject return -1; } } - + /** * Load array lines - * + * * @param int $only_product Return only physical products * @return int <0 if KO, >0 if OK */ function fetch_lines($only_product=0) { $this->lines=array(); - + $sql = 'SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,'; $sql.= ' d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht, d.special_code, d.rang, d.product_type,'; $sql.= ' d.fk_unit,'; @@ -1422,7 +1422,7 @@ class Propal extends CommonObject require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $num = $this->db->num_rows($result); - + $i = 0; while ($i < $num) { @@ -1489,9 +1489,9 @@ class Propal extends CommonObject //print "xx $i ".$this->lines[$i]->fk_product; $i++; } - + $this->db->free($result); - + return 1; } else @@ -2779,7 +2779,7 @@ class Propal extends CommonObject function availability($availability_id, $notrigger=0) { global $user; - + if ($this->statut >= self::STATUS_DRAFT) { $error=0; @@ -3277,13 +3277,14 @@ class Propal extends CommonObject /** * Return clicable link of object (with eventually picto) * - * @param int $withpicto Add picto into link - * @param string $option Where point the link ('expedition', 'document', ...) - * @param string $get_params Parametres added to url - * @param int $notooltip 1=Disable tooltip - * @return string String with URL + * @param int $withpicto Add picto into link + * @param string $option Where point the link ('expedition', 'document', ...) + * @param string $get_params Parametres added to url + * @param int $notooltip 1=Disable tooltip + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL */ - function getNomUrl($withpicto=0,$option='', $get_params='', $notooltip=0) + function getNomUrl($withpicto=0, $option='', $get_params='', $notooltip=0, $save_lastsearch_value=-1) { global $langs, $conf, $user; @@ -3318,6 +3319,14 @@ class Propal extends CommonObject if ($option == 'document') { $url = DOL_URL_ROOT.'/comm/propal/document.php?id='.$this->id. $get_params; } + + if ($option != 'nolink') + { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; + } } $linkclose=''; @@ -3352,9 +3361,9 @@ class Propal extends CommonObject function getLinesArray() { // TODO Duplicate with fetch_lines ? Wich one to keep ? - + $this->lines = array(); - + $sql = 'SELECT pt.rowid, pt.label as custom_label, pt.description, pt.fk_product, pt.fk_remise_except,'; $sql.= ' pt.qty, pt.vat_src_code, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,'; $sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.fk_product_fournisseur_price as fk_fournprice, pt.buy_price_ht as pa_ht, pt.special_code, pt.localtax1_tx, pt.localtax2_tx,'; diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 3e9e5a1205d589d8e9c2d328ccdc6e94899ffec4..01e851769a7d5ccae8349d5d885ab475b4be7523 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -155,10 +155,10 @@ if ($object->id > 0) // Proposal card - - $linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; - - + + $linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; + + $morehtmlref='<div class="refidno">'; // Ref customer $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); @@ -199,12 +199,12 @@ if ($object->id > 0) } } $morehtmlref.='</div>'; - + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); dol_fiche_end(); - - + + // Contacts lines (modules that overwrite templates must declare this into descriptor) $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); foreach($dirtpls as $reldir) diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 0c68a292109fd81deabf0950ad84938a068e70fd..65b8eef5a667a5efa63ab6f0d2a82682c71e2b95 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -103,7 +103,7 @@ if ($object->id > 0) // Proposal card - $linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; + $linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; $morehtmlref='<div class="refidno">'; diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index d8af8fb87a8fa7828009645250d508e329ea4a4d..a94eeaa092cb6ddba2950d18e100d6e53aa73706 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -66,7 +66,7 @@ $object->info($object->id); // Proposal card -$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; +$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; $morehtmlref='<div class="refidno">'; @@ -122,6 +122,6 @@ dol_print_object_info($object); print '</div>'; dol_fiche_end(); - + llxFooter(); $db->close(); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 39ee93fd9cd9571509d27d0f8246c77d7da7661d..e9626a638b8a9bd65cc48cb9727f451307c53ef8 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -80,9 +80,9 @@ $object_statut=GETPOST('propal_statut'); $sall=GETPOST('sall', 'alphanohtml'); $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg")); -$day=GETPOST("day","int"); -$month=GETPOST("month","int"); -$year=GETPOST("year","int"); +$search_day=GETPOST("search_day","int"); +$search_month=GETPOST("search_month","int"); +$search_year=GETPOST("search_year","int"); $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); @@ -197,9 +197,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_type=''; $search_country=''; $search_type_thirdparty=''; - $year=''; - $month=''; - $day=''; + $search_year=''; + $search_month=''; + $search_day=''; $viewstatut=''; $object_statut=''; $toselect=''; @@ -295,18 +295,18 @@ if ($viewstatut != '' && $viewstatut != '-1') { $sql.= ' AND p.fk_statut IN ('.$db->escape($viewstatut).')'; } -if ($month > 0) +if ($search_month > 0) { - if ($year > 0 && empty($day)) - $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'"; - else if ($year > 0 && ! empty($day)) - $sql.= " AND p.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; + if ($search_year > 0 && empty($search_day)) + $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'"; + else if ($search_year > 0 && ! empty($search_day)) + $sql.= " AND p.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'"; else - $sql.= " AND date_format(p.datep, '%m') = '".$db->escape($month)."'"; + $sql.= " AND date_format(p.datep, '%m') = '".$db->escape($search_month)."'"; } -else if ($year > 0) +else if ($search_year > 0) { - $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; + $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'"; } if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$db->escape($search_sale); if ($search_user > 0) @@ -369,8 +369,8 @@ if ($resql) if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); if ($sall) $param.='&sall='.urlencode($sall); - if ($month) $param.='&month='.urlencode($month); - if ($year) $param.='&year='.urlencode($year); + if ($search_month) $param.='&search_month='.urlencode($search_month); + if ($search_year) $param.='&search_year='.urlencode($search_year); if ($search_ref) $param.='&search_ref='.urlencode($search_ref); if ($search_refcustomer) $param.='&search_refcustomer='.urlencode($search_refcustomer); if ($search_societe) $param.='&search_societe='.urlencode($search_societe); @@ -613,11 +613,10 @@ if ($resql) { print '<td class="liste_titre" colspan="1" align="center">'; //print $langs->trans('Month').': '; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">'; - print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">'; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">'; + print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">'; //print ' '.$langs->trans('Year').': '; - $syear = $year; - $formother->select_year($syear,'year',1, 20, 5); + $formother->select_year($search_year,'search_year',1, 20, 5); print '</td>'; } // Date end @@ -755,7 +754,6 @@ if ($resql) { $obj = $db->fetch_object($resql); - $objectstatic->id=$obj->rowid; $objectstatic->ref=$obj->ref; @@ -768,7 +766,7 @@ if ($resql) print '<table class="nobordernopadding"><tr class="nocellnopadd">'; // Picto + Ref print '<td class="nobordernopadding nowrap">'; - print $objectstatic->getNomUrl(1); + print $objectstatic->getNomUrl(1, '', '', 0, 1); print '</td>'; // Warning $warnornote=''; diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index ec1dac31c24d2271a377abdc7da3cff24b202434..29fc43b0899ae3d7f7928d3b3a3df293b89e795a 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -56,7 +56,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, /* - * View + * View */ llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); @@ -79,13 +79,13 @@ if ($id > 0 || ! empty($ref)) $cssclass='titlefield'; //if ($action == 'editnote_public') $cssclass='titlefieldcreate'; //if ($action == 'editnote_private') $cssclass='titlefieldcreate'; - - + + // Proposal card - - $linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; - - + + $linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; + + $morehtmlref='<div class="refidno">'; // Ref customer $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); @@ -126,17 +126,17 @@ if ($id > 0 || ! empty($ref)) } } $morehtmlref.='</div>'; - + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); print '<div class="fichecenter">'; print '<div class="underbanner clearboth"></div>'; - + $cssclass="titlefield"; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; print '</div>'; - + dol_fiche_end(); } } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 826046db3eeb63251eed62394b0550295357de71..13fe07f78dfff9378b3476f3b1a63c9280235ace 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1915,7 +1915,7 @@ if ($action == 'create' && $user->rights->commande->creer) // Order card - $linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; + $linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; $morehtmlref='<div class="refidno">'; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 93df2f1aa0b4360f2e0d49fc5e01aab1fe519a9f..0910fedcb9de4c4831c62b7a069be6398f5f126f 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -706,10 +706,10 @@ class Commande extends CommonOrder // Clean parameters $this->brouillon = 1; // set command as draft - + // $date_commande is deprecated $date = ($this->date_commande ? $this->date_commande : $this->date); - + // Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate) if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); @@ -1468,7 +1468,7 @@ class Commande extends CommonOrder $tva_npr = get_default_npr($mysoc,$this->thirdparty,$prod->id); if (empty($tva_tx)) $tva_npr=0; $vat_src_code = ''; // May be defined into tva_tx - + $localtax1_tx=get_localtax($tva_tx,1,$this->thirdparty,$mysoc,$tva_npr); $localtax2_tx=get_localtax($tva_tx,2,$this->thirdparty,$mysoc,$tva_npr); @@ -1798,7 +1798,7 @@ class Commande extends CommonOrder $line->product_type = $objp->product_type; $line->qty = $objp->qty; - $line->vat_src_code = $objp->vat_src_code; + $line->vat_src_code = $objp->vat_src_code; $line->tva_tx = $objp->tva_tx; $line->localtax1_tx = $objp->localtax1_tx; $line->localtax2_tx = $objp->localtax2_tx; @@ -3106,7 +3106,7 @@ class Commande extends CommonOrder $error = 0; dol_syslog(get_class($this) . "::delete ".$this->id, LOG_DEBUG); - + $this->db->begin(); if (! $error && ! $notrigger) @@ -3369,24 +3369,33 @@ class Commande extends CommonOrder /** * Return clicable link of object (with eventually picto) * - * @param int $withpicto Add picto into link - * @param int $option Where point the link (0=> main card, 1,2 => shipment) - * @param int $max Max length to show - * @param int $short ??? - * @param int $notooltip 1=Disable tooltip - * @return string String with URL + * @param int $withpicto Add picto into link + * @param int $option Where point the link (0=> main card, 1,2 => shipment) + * @param int $max Max length to show + * @param int $short ??? + * @param int $notooltip 1=Disable tooltip + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL */ - function getNomUrl($withpicto=0,$option=0,$max=0,$short=0,$notooltip=0) + function getNomUrl($withpicto=0, $option=0, $max=0, $short=0, $notooltip=0, $save_lastsearch_value=-1) { global $conf, $langs, $user; if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips - + $result=''; if (! empty($conf->expedition->enabled) && ($option == 1 || $option == 2)) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id; else $url = DOL_URL_ROOT.'/commande/card.php?id='.$this->id; + if ($option !== 'nolink') + { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; + } + if ($short) return $url; $picto = 'order'; @@ -3418,7 +3427,7 @@ class Commande extends CommonOrder $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose.=' class="classfortooltip"'; } - + $linkstart = '<a href="'.$url.'"'; $linkstart.=$linkclose.'>'; $linkend='</a>'; diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index fe37a630c5dbd3be130d3f35b0d06bc108d30812..0eb4ed2cd63bb0905c7be01d615d571e3238042e 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -142,16 +142,16 @@ if ($id > 0 || ! empty($ref)) if ($object->fetch($id, $ref) > 0) { $object->fetch_thirdparty(); - + $head = commande_prepare_head($object); dol_fiche_head($head, 'contact', $langs->trans("CustomerOrder"), -1, 'order'); - + // Order card - - $linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; - - + + $linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; + + $morehtmlref='<div class="refidno">'; // Ref customer $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); @@ -191,7 +191,7 @@ if ($id > 0 || ! empty($ref)) } } } - $morehtmlref.='</div>'; + $morehtmlref.='</div>'; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 0996907b245f682014a52398a16afd4f0ce47319..7eea9c958770c6bc39feb2e31f300b04d4927caf 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -101,12 +101,12 @@ if ($id > 0 || ! empty($ref)) { $totalsize+=$file['size']; } - + // Order card - - $linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; - - + + $linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; + + $morehtmlref='<div class="refidno">'; // Ref customer $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); @@ -147,25 +147,25 @@ if ($id > 0 || ! empty($ref)) } } $morehtmlref.='</div>'; - + // Order card - + $linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; - - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + print '<div class="fichecenter">'; print '<div class="underbanner clearboth"></div>'; - + print '<table class="border" width="100%">'; print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>'; print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>'; print "</table>\n"; - + print "</div>\n"; - + print dol_fiche_end(); $modulepart = 'commande'; diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php index 02b631c4c8a5aeaece832ee57b0395f903ea0b8f..05adc9def549e6b824da89f5afbeee515a6dd06f 100644 --- a/htdocs/commande/info.php +++ b/htdocs/commande/info.php @@ -65,7 +65,7 @@ dol_fiche_head($head, 'info', $langs->trans("CustomerOrder"), -1, 'order'); // Order card -$linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; +$linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; $morehtmlref='<div class="refidno">'; // Ref customer diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 73fa9c5b66eb64fa2701e6979b183b8283503b2b..8ce3ba7cd0430c1e378e7ddce21ebb77809f6d3a 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -51,12 +51,12 @@ $show_files=GETPOST('show_files','int'); $confirm=GETPOST('confirm','alpha'); $toselect = GETPOST('toselect', 'array'); -$orderyear=GETPOST("orderyear","int"); -$ordermonth=GETPOST("ordermonth","int"); -$orderday=GETPOST("orderday","int"); -$deliveryyear=GETPOST("deliveryyear","int"); -$deliverymonth=GETPOST("deliverymonth","int"); -$deliveryday=GETPOST("deliveryday","int"); +$search_orderyear=GETPOST("search_orderyear","int"); +$search_ordermonth=GETPOST("search_ordermonth","int"); +$search_orderday=GETPOST("search_orderday","int"); +$search_deliveryyear=GETPOST("search_deliveryyear","int"); +$search_deliverymonth=GETPOST("search_deliverymonth","int"); +$search_deliveryday=GETPOST("search_deliveryday","int"); $search_product_category=GETPOST('search_product_category','int'); $search_ref=GETPOST('search_ref','alpha')!=''?GETPOST('search_ref','alpha'):GETPOST('sref','alpha'); $search_ref_customer=GETPOST('search_ref_customer','alpha'); @@ -180,12 +180,12 @@ if (empty($reshook)) $search_total_ht=''; $search_total_vat=''; $search_total_ttc=''; - $orderyear=''; - $ordermonth=''; - $orderday=''; - $deliveryday=''; - $deliverymonth=''; - $deliveryyear=''; + $search_orderyear=''; + $search_ordermonth=''; + $search_orderday=''; + $search_deliveryday=''; + $search_deliverymonth=''; + $search_deliveryyear=''; $viewstatut=''; $billed=''; $toselect=''; @@ -499,31 +499,31 @@ if ($viewstatut <> '') $sql .= ' AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))'; // validated, in process or closed but not billed } } -if ($ordermonth > 0) +if ($search_ordermonth > 0) { - if ($orderyear > 0 && empty($orderday)) - $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_get_first_day($orderyear,$ordermonth,false))."' AND '".$db->idate(dol_get_last_day($orderyear,$ordermonth,false))."'"; - else if ($orderyear > 0 && ! empty($orderday)) - $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $ordermonth, $orderday, $orderyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $ordermonth, $orderday, $orderyear))."'"; + if ($search_orderyear > 0 && empty($search_orderday)) + $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_get_first_day($search_orderyear,$search_ordermonth,false))."' AND '".$db->idate(dol_get_last_day($search_orderyear,$search_ordermonth,false))."'"; + else if ($search_orderyear > 0 && ! empty($search_orderday)) + $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_ordermonth, $search_orderday, $search_orderyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_ordermonth, $search_orderday, $search_orderyear))."'"; else - $sql.= " AND date_format(c.date_commande, '%m') = '".$ordermonth."'"; + $sql.= " AND date_format(c.date_commande, '%m') = '".$search_ordermonth."'"; } -else if ($orderyear > 0) +else if ($search_orderyear > 0) { - $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_get_first_day($orderyear,1,false))."' AND '".$db->idate(dol_get_last_day($orderyear,12,false))."'"; + $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_get_first_day($search_orderyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_orderyear,12,false))."'"; } -if ($deliverymonth > 0) +if ($search_deliverymonth > 0) { - if ($deliveryyear > 0 && empty($deliveryday)) - $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($deliveryyear,$deliverymonth,false))."' AND '".$db->idate(dol_get_last_day($deliveryyear,$deliverymonth,false))."'"; - else if ($deliveryyear > 0 && ! empty($deliveryday)) - $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $deliverymonth, $deliveryday, $deliveryyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $deliverymonth, $deliveryday, $deliveryyear))."'"; + if ($search_deliveryyear > 0 && empty($search_deliveryday)) + $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($search_deliveryyear,$search_deliverymonth,false))."' AND '".$db->idate(dol_get_last_day($search_deliveryyear,$search_deliverymonth,false))."'"; + else if ($search_deliveryyear > 0 && ! empty($search_deliveryday)) + $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_deliverymonth, $search_deliveryday, $search_deliveryyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_deliverymonth, $search_deliveryday, $search_deliveryyear))."'"; else - $sql.= " AND date_format(c.date_livraison, '%m') = '".$deliverymonth."'"; + $sql.= " AND date_format(c.date_livraison, '%m') = '".$search_deliverymonth."'"; } -else if ($deliveryyear > 0) +else if ($search_deliveryyear > 0) { - $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($deliveryyear,1,false))."' AND '".$db->idate(dol_get_last_day($deliveryyear,12,false))."'"; + $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($search_deliveryyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_deliveryyear,12,false))."'"; } if ($search_town) $sql.= natural_search('s.town', $search_town); if ($search_zip) $sql.= natural_search("s.zip",$search_zip); @@ -605,12 +605,12 @@ if ($resql) if ($sall) $param.='&sall='.$sall; if ($socid > 0) $param.='&socid='.$socid; if ($viewstatut != '') $param.='&viewstatut='.$viewstatut; - if ($orderday) $param.='&orderday='.$orderday; - if ($ordermonth) $param.='&ordermonth='.$ordermonth; - if ($orderyear) $param.='&orderyear='.$orderyear; - if ($deliveryday) $param.='&deliveryday='.$deliveryday; - if ($deliverymonth) $param.='&deliverymonth='.$deliverymonth; - if ($deliveryyear) $param.='&deliveryyear='.$deliveryyear; + if ($search_orderday) $param.='&search_orderday='.$search_orderday; + if ($search_ordermonth) $param.='&search_ordermonth='.$search_ordermonth; + if ($search_orderyear) $param.='&search_orderyear='.$search_orderyear; + if ($search_deliveryday) $param.='&search_deliveryday='.$search_deliveryday; + if ($search_deliverymonth) $param.='&search_deliverymonth='.$search_deliverymonth; + if ($search_deliveryyear) $param.='&search_deliveryyear='.$search_deliveryyear; if ($search_ref) $param.='&search_ref='.$search_ref; if ($search_company) $param.='&search_company='.$search_company; if ($search_ref_customer) $param.='&search_ref_customer='.$search_ref_customer; @@ -894,17 +894,17 @@ if ($resql) if (! empty($arrayfields['c.date_commande']['checked'])) { print '<td class="liste_titre" align="center">'; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="orderday" value="'.$orderday.'">'; - print '<input class="flat" type="text" size="1" maxlength="2" name="ordermonth" value="'.$ordermonth.'">'; - $formother->select_year($orderyear?$orderyear:-1,'orderyear',1, 20, 5); + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_orderday" value="'.$search_orderday.'">'; + print '<input class="flat" type="text" size="1" maxlength="2" name="search_ordermonth" value="'.$search_ordermonth.'">'; + $formother->select_year($search_orderyear?$search_orderyear:-1,'search_orderyear',1, 20, 5); print '</td>'; } if (! empty($arrayfields['c.date_delivery']['checked'])) { print '<td class="liste_titre" align="center">'; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="deliveryday" value="'.$deliveryday.'">'; - print '<input class="flat" type="text" size="1" maxlength="2" name="deliverymonth" value="'.$deliverymonth.'">'; - $formother->select_year($deliveryyear?$deliveryyear:-1,'deliveryyear',1, 20, 5); + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_deliveryday" value="'.$search_deliveryday.'">'; + print '<input class="flat" type="text" size="1" maxlength="2" name="search_deliverymonth" value="'.$search_deliverymonth.'">'; + $formother->select_year($search_deliveryyear?$search_deliveryyear:-1,'search_deliveryyear',1, 20, 5); print '</td>'; } if (! empty($arrayfields['c.total_ht']['checked'])) @@ -1075,7 +1075,7 @@ if ($resql) print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<td class="nobordernopadding nowrap">'; - print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$obj->fk_statut)); + print $generic_commande->getNomUrl(1, ($viewstatut != 2?0:$obj->fk_statut), 0, 0, 0, 1); print '</td>'; // Show shippable Icon (create subloop, so may be slow) diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index 79475c7591795d3430037836aaf261028a6b7803..0d42cc696117f5252fe7218c036deb3da5d00405 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -72,16 +72,16 @@ $form = new Form($db); if ($id > 0 || ! empty($ref)) { $object->fetch_thirdparty(); - + $head = commande_prepare_head($object); - + dol_fiche_head($head, 'note', $langs->trans("CustomerOrder"), -1, 'order'); // Order card - - $linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; - - + + $linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; + + $morehtmlref='<div class="refidno">'; // Ref customer $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); @@ -122,20 +122,20 @@ if ($id > 0 || ! empty($ref)) } } $morehtmlref.='</div>'; - - + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - + + print '<div class="fichecenter">'; print '<div class="underbanner clearboth"></div>'; - - + + $cssclass="titlefield"; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; print '</div>'; - + dol_fiche_end(); } diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index b9fcf6b7aa39a664b54e71f1ba6d0610da747ed5..fdba026ac6fb127ac464b310681e7a223561a11d 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -201,7 +201,7 @@ if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT DISTINCT s.rowid as socid, s.nom as name, s.zip, s.town, s.fk_pays,"; $sql.= " sum(f.total) as amount, sum(f.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; - if ($selected_cat === -2) // Without any category + if ($selected_cat === -2) // Without any category { $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; } @@ -219,7 +219,7 @@ if ($modecompta == 'CREANCES-DETTES') { if ($date_start && $date_end) { $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; } - if ($selected_cat === -2) // Without any category + if ($selected_cat === -2) // Without any category { $sql.=" AND cs.fk_soc is null"; } @@ -239,7 +239,7 @@ if ($modecompta == 'CREANCES-DETTES') { $sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf"; $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; - if ($selected_cat === -2) // Without any category + if ($selected_cat === -2) // Without any category { $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; } @@ -253,7 +253,7 @@ if ($modecompta == 'CREANCES-DETTES') { if ($date_start && $date_end) { $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; } - if ($selected_cat === -2) // Without any category + if ($selected_cat === -2) // Without any category { $sql.=" AND cs.fk_soc is null"; } @@ -360,7 +360,28 @@ print '<td colspan="7" align="right">'; print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '</td>'; print '</tr>'; - // Array titles + +print '<tr class="liste_titre">'; +print '<td class="liste_titre" align="left">'; +print '<input class="flat" size="6" type="text" name="search_societe" value="'.$search_societe.'">'; +print '</td>'; +print '<td class="liste_titre" align="left">'; +print '<input class="flat" size="6" type="text" name="search_zip" value="'.$search_zip.'">'; +print '</td>'; +print '<td class="liste_titre" align="left">'; +print '<input class="flat" size="6" type="text" name="search_town" value="'.$search_town.'">'; +print '</td>'; +print '<td class="liste_titre" align="left">'; +print $form->select_country($search_country, 'search_country'); +//print '<input class="flat" size="6" type="text" name="search_country" value="'.$search_country.'">'; +print '</td>'; +print '<td class="liste_titre"> </td>'; +print '<td class="liste_titre"> </td>'; +print '<td class="liste_titre"> </td>'; +print '<td class="liste_titre"> </td>'; +print '</tr>'; + +// Array titles print "<tr class='liste_titre'>"; print_liste_field_titre( $langs->trans("Company"), @@ -442,27 +463,6 @@ print_liste_field_titre( ); print "</tr>\n"; -print '<tr class="liste_titre">'; -print '<td class="liste_titre" align="left">'; -print '<input class="flat" size="6" type="text" name="search_societe" value="'.$search_societe.'">'; -print '</td>'; -print '<td class="liste_titre" align="left">'; -print '<input class="flat" size="6" type="text" name="search_zip" value="'.$search_zip.'">'; -print '</td>'; -print '<td class="liste_titre" align="left">'; -print '<input class="flat" size="6" type="text" name="search_town" value="'.$search_town.'">'; -print '</td>'; -print '<td class="liste_titre" align="left">'; -print $form->select_country($search_country, 'search_country'); -//print '<input class="flat" size="6" type="text" name="search_country" value="'.$search_country.'">'; -print '</td>'; -print '<td class="liste_titre"> </td>'; -print '<td class="liste_titre"> </td>'; -print '<td class="liste_titre"> </td>'; -print '<td class="liste_titre"> </td>'; -print '</tr>'; - -$var=true; if (count($amount)) { $arrayforsort=$name; @@ -517,7 +517,7 @@ if (count($amount)) { } foreach($arrayforsort as $key=>$value) { - + print '<tr class="oddeven">'; // Third party diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 557d48be6802a2e1622ce7debd6eff2ca7f4881b..29cea1eb019d6c4dd0d681cdc0eda2a9d2c1a9a0 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -1,6 +1,7 @@ <?php /* Copyright (C) 2014-2017 Alexandre Spangaro <aspangaro@zendsi.com> * Copyright (C) 2015 Frederic France <frederic.france@free.fr> + * Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -335,7 +336,7 @@ if ($action == 'create') if (! empty($conf->accounting->enabled)) { // Accountancy_account_capital - print '<tr><td class="titlefieldcreate">'.$langs->trans("LoanAccountancyCapitalCode").'</td>'; + print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("LoanAccountancyCapitalCode").'</td>'; print '<td>'; print $formaccounting->select_account($object->accountancy_account_capital, 'accountancy_account_capital', 1, '', 0, 1); print '</td></tr>'; @@ -415,7 +416,7 @@ if ($id > 0) print '<input type="hidden" name="id" value="'.$id.'">'; } - dol_fiche_head($head, 'card', $langs->trans("Loan"), 0, 'bill'); + dol_fiche_head($head, 'card', $langs->trans("Loan"), -1, 'bill'); print '<script type="text/javascript">' . "\n"; print ' function popEcheancier() {' . "\n"; @@ -712,9 +713,9 @@ if ($id > 0) print ' '; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '</div>'; - } - if ($action == 'edit') print "</form>\n"; + print '</form>'; + } /* * Buttons actions diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index d7ba1f979b41d06aba1a2b9e61721d807bc3c789..1136e1c1fc4d1ab68c715173f81ebbc13f0eae82 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -267,7 +267,9 @@ input.select2-input { border-bottom: solid 1px rgba(0,0,0,.2) !important; /* required to avoid to lose bottom line when focus is lost on select2. */ } -.liste_titre input[name=monthvalid], .liste_titre input[name=search_smonth], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month], .liste_titre select[name=month], .liste_titre input[name=month_lim] { +.liste_titre input[name=monthvalid], .liste_titre input[name=search_ordermonth], .liste_titre input[name=search_deliverymonth], +.liste_titre input[name=search_smonth], .liste_titre input[name=search_month], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month], .liste_titre select[name=month], +.liste_titre input[name=month_lim] { margin-right: 4px; } input[type=submit] { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index a2c9b20c63bad934169d1ad56d7dad6f68b07a82..978b093fc9df0bba72c1deeb14a4105807b53dc5 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -282,7 +282,9 @@ textarea.cke_source:focus box-shadow: none; } -.liste_titre input[name=monthvalid], .liste_titre input[name=search_smonth], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month], .liste_titre input[name=month_lim] { +.liste_titre input[name=monthvalid], .liste_titre input[name=search_ordermonth], .liste_titre input[name=search_deliverymonth], +.liste_titre input[name=search_smonth], .liste_titre input[name=search_month], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month], +.liste_titre input[name=month_lim] { margin-right: 4px; } input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select {