Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
03d1b4bac0
@ -1738,7 +1738,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||||
$fileparams = dol_most_recent_file($conf->askpricesupplier->dir_output . '/' . $ref, preg_quote($ref, '/'));
|
$fileparams = dol_most_recent_file($conf->askpricesupplier->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
$file = $fileparams['fullname'];
|
$file = $fileparams['fullname'];
|
||||||
|
|
||||||
// Define output language
|
// Define output language
|
||||||
@ -1764,7 +1764,7 @@ if ($action == 'create')
|
|||||||
dol_print_error($db, $result);
|
dol_print_error($db, $result);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->askpricesupplier->dir_output . '/' . $ref, preg_quote($ref, '/'));
|
$fileparams = dol_most_recent_file($conf->askpricesupplier->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
$file = $fileparams['fullname'];
|
$file = $fileparams['fullname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||||
if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||||
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||||
@ -469,10 +470,12 @@ if ($id > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Categories
|
// Categories
|
||||||
print '<tr><td>' . $langs->trans( "Categories" ) . '</td>';
|
if (!empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire )) {
|
||||||
print '<td colspan="3">';
|
print '<tr><td>' . $langs->trans( "Categories" ) . '</td>';
|
||||||
print $form->showCategories( $object->id, 'customer', 1 );
|
print '<td colspan="3">';
|
||||||
print "</td></tr>";
|
print $form->showCategories( $object->id, 'customer', 1 );
|
||||||
|
print "</td></tr>";
|
||||||
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters=array('socid'=>$object->id, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
|
$parameters=array('socid'=>$object->id, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
|
||||||
|
|||||||
@ -2340,7 +2340,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||||
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
|
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
$file = $fileparams['fullname'];
|
$file = $fileparams['fullname'];
|
||||||
|
|
||||||
// Define output language
|
// Define output language
|
||||||
@ -2365,7 +2365,7 @@ if ($action == 'create')
|
|||||||
dol_print_error($db, $result);
|
dol_print_error($db, $result);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
|
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
$file = $fileparams['fullname'];
|
$file = $fileparams['fullname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2358,7 +2358,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
dol_print_error($db, $result);
|
dol_print_error($db, $result);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
|
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
$file = $fileparams['fullname'];
|
$file = $fileparams['fullname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3821,7 +3821,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||||
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
|
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
$file = $fileparams['fullname'];
|
$file = $fileparams['fullname'];
|
||||||
|
|
||||||
// Define output language
|
// Define output language
|
||||||
@ -3846,7 +3846,7 @@ if ($action == 'create')
|
|||||||
dol_print_error($db, $result);
|
dol_print_error($db, $result);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
|
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
$file = $fileparams['fullname'];
|
$file = $fileparams['fullname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
|
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -88,6 +89,9 @@ $search_sale = GETPOST('search_sale','int');
|
|||||||
$day = GETPOST('day','int');
|
$day = GETPOST('day','int');
|
||||||
$month = GETPOST('month','int');
|
$month = GETPOST('month','int');
|
||||||
$year = GETPOST('year','int');
|
$year = GETPOST('year','int');
|
||||||
|
$day_lim = GETPOST('day_lim','int');
|
||||||
|
$month_lim = GETPOST('month_lim','int');
|
||||||
|
$year_lim = GETPOST('year_lim','int');
|
||||||
$filtre = GETPOST('filtre');
|
$filtre = GETPOST('filtre');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
@ -213,6 +217,19 @@ else if ($year > 0)
|
|||||||
{
|
{
|
||||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
||||||
}
|
}
|
||||||
|
if ($month_lim > 0)
|
||||||
|
{
|
||||||
|
if ($year_lim > 0 && empty($day_lim))
|
||||||
|
$sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_get_first_day($year_lim,$month_lim,false))."' AND '".$db->idate(dol_get_last_day($year_lim,$month_lim,false))."'";
|
||||||
|
else if ($year_lim > 0 && ! empty($day_lim))
|
||||||
|
$sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_lim, $day_lim, $year_lim))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month_lim, $day_lim, $year_lim))."'";
|
||||||
|
else
|
||||||
|
$sql.= " AND date_format(f.date_lim_reglement, '%m') = '".$month_lim."'";
|
||||||
|
}
|
||||||
|
else if ($year_lim > 0)
|
||||||
|
{
|
||||||
|
$sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_get_first_day($year_lim,1,false))."' AND '".$db->idate(dol_get_last_day($year_lim,12,false))."'";
|
||||||
|
}
|
||||||
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
|
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
|
||||||
if ($search_user > 0)
|
if ($search_user > 0)
|
||||||
{
|
{
|
||||||
@ -322,7 +339,11 @@ if ($resql)
|
|||||||
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
|
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
|
||||||
$formother->select_year($year?$year:-1,'year',1, 20, 5);
|
$formother->select_year($year?$year:-1,'year',1, 20, 5);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre" align="left"> </td>';
|
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="day_lim" value="'.$day_lim.'">';
|
||||||
|
print '<input class="flat" type="text" size="1" maxlength="2" name="month_lim" value="'.$month_lim.'">';
|
||||||
|
$formother->select_year($year_lim?$year_lim:-1,'year_lim',1, 20, 5);
|
||||||
|
print '</td>';
|
||||||
print '<td class="liste_titre" align="left"><input class="flat" type="text" size="8" name="search_societe" value="'.$search_societe.'"></td>';
|
print '<td class="liste_titre" align="left"><input class="flat" type="text" size="8" name="search_societe" value="'.$search_societe.'"></td>';
|
||||||
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="6" name="search_montant_ht" value="'.$search_montant_ht.'"></td>';
|
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="6" name="search_montant_ht" value="'.$search_montant_ht.'"></td>';
|
||||||
print '<td class="liste_titre" align="right"> </td>';
|
print '<td class="liste_titre" align="right"> </td>';
|
||||||
|
|||||||
@ -275,7 +275,7 @@ if ($action == "builddoc" && $user->rights->facture->lire && ! GETPOST('button_s
|
|||||||
{
|
{
|
||||||
$arrayofinclusion=array();
|
$arrayofinclusion=array();
|
||||||
foreach($_POST['toGenerate'] as $tmppdf) $arrayofinclusion[]=preg_quote($tmppdf.'.pdf','/');
|
foreach($_POST['toGenerate'] as $tmppdf) $arrayofinclusion[]=preg_quote($tmppdf.'.pdf','/');
|
||||||
$factures = dol_dir_list($conf->facture->dir_output,'all',1,implode('|',$arrayofinclusion),'\.meta$|\.png','date',SORT_DESC);
|
$factures = dol_dir_list($conf->facture->dir_output,'all',1,implode('|',$arrayofinclusion),'\.meta$|\.png','date',SORT_DESC,0,true);
|
||||||
|
|
||||||
// liste les fichiers
|
// liste les fichiers
|
||||||
$files = array();
|
$files = array();
|
||||||
@ -284,7 +284,7 @@ if ($action == "builddoc" && $user->rights->facture->lire && ! GETPOST('button_s
|
|||||||
{
|
{
|
||||||
foreach($factures as $facture)
|
foreach($factures as $facture)
|
||||||
{
|
{
|
||||||
if(strstr($facture["name"],$basename))
|
if (strstr($facture["name"],$basename))
|
||||||
{
|
{
|
||||||
$files[] = $conf->facture->dir_output.'/'.$basename.'/'.$facture["name"];
|
$files[] = $conf->facture->dir_output.'/'.$basename.'/'.$facture["name"];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT. '/core/class/html.form.class.php';
|
require_once DOL_DOCUMENT_ROOT. '/core/class/html.form.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$langs->load("users");
|
$langs->load("users");
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
@ -220,7 +221,17 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$error++; $errors=array_merge($errors,($object->error?array($object->error):$object->errors));
|
$error++; $errors=array_merge($errors,($object->error?array($object->error):$object->errors));
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
}
|
} else {
|
||||||
|
// Categories association
|
||||||
|
$contcats = GETPOST( 'contcats', 'array' );
|
||||||
|
if (!empty( $contcats )) {
|
||||||
|
$cat = new Categorie( $db );
|
||||||
|
foreach ($contcats as $id_category) {
|
||||||
|
$cat->fetch( $id_category );
|
||||||
|
$cat->add_type( $object, 'contact' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error && $id > 0)
|
if (! $error && $id > 0)
|
||||||
@ -313,8 +324,22 @@ if (empty($reshook))
|
|||||||
|
|
||||||
$result = $object->update($contactid, $user);
|
$result = $object->update($contactid, $user);
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0) {
|
||||||
{
|
// Categories association
|
||||||
|
// First we delete all categories association
|
||||||
|
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'categorie_contact';
|
||||||
|
$sql .= ' WHERE fk_socpeople = ' . $object->id;
|
||||||
|
$db->query( $sql );
|
||||||
|
|
||||||
|
// Then we add the associated categories
|
||||||
|
$categories = GETPOST( 'contcats', 'array' );
|
||||||
|
if (!empty( $categories )) {
|
||||||
|
$cat = new Categorie( $db );
|
||||||
|
foreach ($categories as $id_category) {
|
||||||
|
$cat->fetch( $id_category );
|
||||||
|
$cat->add_type( $object, 'contact' );
|
||||||
|
}
|
||||||
|
}
|
||||||
$object->old_lastname='';
|
$object->old_lastname='';
|
||||||
$object->old_firstname='';
|
$object->old_firstname='';
|
||||||
$action = 'view';
|
$action = 'view';
|
||||||
@ -580,6 +605,15 @@ else
|
|||||||
print $form->selectarray('priv',$selectarray,(GETPOST("priv",'alpha')?GETPOST("priv",'alpha'):$object->priv),0);
|
print $form->selectarray('priv',$selectarray,(GETPOST("priv",'alpha')?GETPOST("priv",'alpha'):$object->priv),0);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Categories
|
||||||
|
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) {
|
||||||
|
print '<tr><td>' . fieldLabel( 'Categories', 'contcats' ) . '</td><td colspan="3">';
|
||||||
|
$cate_arbo = $form->select_all_categories( Categorie::TYPE_CONTACT, null, 'parent', null, null, 1 );
|
||||||
|
print $form->multiselectarray( 'contcats', $cate_arbo, GETPOST( 'contcats', 'array' ), null, null, null,
|
||||||
|
null, '90%' );
|
||||||
|
print "</td></tr>";
|
||||||
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters=array('colspan' => ' colspan="3"');
|
$parameters=array('colspan' => ' colspan="3"');
|
||||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||||
@ -819,6 +853,20 @@ else
|
|||||||
print $object->getLibStatut(4);
|
print $object->getLibStatut(4);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Categories
|
||||||
|
if (!empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire )) {
|
||||||
|
print '<tr><td>' . fieldLabel( 'Categories', 'contcats' ) . '</td>';
|
||||||
|
print '<td colspan="3">';
|
||||||
|
$cate_arbo = $form->select_all_categories( Categorie::TYPE_CONTACT, null, null, null, null, 1 );
|
||||||
|
$c = new Categorie( $db );
|
||||||
|
$cats = $c->containing( $object->id, Categorie::TYPE_CONTACT );
|
||||||
|
foreach ($cats as $cat) {
|
||||||
|
$arrayselected[] = $cat->id;
|
||||||
|
}
|
||||||
|
print $form->multiselectarray( 'contcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%' );
|
||||||
|
print "</td></tr>";
|
||||||
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters=array('colspan' => ' colspan="3"');
|
$parameters=array('colspan' => ' colspan="3"');
|
||||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||||
@ -1043,6 +1091,15 @@ else
|
|||||||
print $object->getLibStatut(4);
|
print $object->getLibStatut(4);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
// Categories
|
||||||
|
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) {
|
||||||
|
print '<tr><td>' . $langs->trans( "Categories" ) . '</td>';
|
||||||
|
print '<td colspan="3">';
|
||||||
|
print $form->showCategories( $object->id, 'contact', 1 );
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"');
|
$parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"');
|
||||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||||
|
|||||||
@ -689,7 +689,7 @@ class FormFile
|
|||||||
$out='';
|
$out='';
|
||||||
$this->numoffiles=0;
|
$this->numoffiles=0;
|
||||||
|
|
||||||
$file_list=dol_dir_list($filedir, 'files', 0, preg_quote(basename($modulesubdir).'.pdf','/'), '\.meta$|\.png$');
|
$file_list=dol_dir_list($filedir, 'files', 0, preg_quote(basename($modulesubdir),'/').'[^\-]+', '\.meta$|\.png$');
|
||||||
|
|
||||||
// For ajax treatment
|
// For ajax treatment
|
||||||
$out.= '<div id="gen_pdf_'.$modulesubdir.'" class="linkobject hideobject">'.img_picto('', 'refresh').'</div>'."\n";
|
$out.= '<div id="gen_pdf_'.$modulesubdir.'" class="linkobject hideobject">'.img_picto('', 'refresh').'</div>'."\n";
|
||||||
@ -718,7 +718,7 @@ class FormFile
|
|||||||
$mime=dol_mimetype($relativepath,'',0);
|
$mime=dol_mimetype($relativepath,'',0);
|
||||||
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
|
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
|
||||||
$out.= '>';
|
$out.= '>';
|
||||||
$out.= img_pdf($file["name"],2);
|
$out.= img_mime($relativepath, $file["name"]);
|
||||||
$out.= '</a>'."\n";
|
$out.= '</a>'."\n";
|
||||||
|
|
||||||
$this->numoffiles++;
|
$this->numoffiles++;
|
||||||
|
|||||||
@ -87,16 +87,6 @@ function contact_prepare_head(Contact $object)
|
|||||||
$head[$tab][2] = 'documents';
|
$head[$tab][2] = 'documents';
|
||||||
$tab++;
|
$tab++;
|
||||||
|
|
||||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
|
||||||
{
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
|
||||||
$type = Categorie::TYPE_CONTACT;
|
|
||||||
$head[$tab][0] = DOL_URL_ROOT.'/categories/categorie.php?id='.$object->id."&type=".$type;
|
|
||||||
$head[$tab][1] = $langs->trans('Categories');
|
|
||||||
$head[$tab][2] = 'category';
|
|
||||||
$tab++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Info
|
// Info
|
||||||
$head[$tab][0] = DOL_URL_ROOT.'/contact/info.php?id='.$object->id;
|
$head[$tab][0] = DOL_URL_ROOT.'/contact/info.php?id='.$object->id;
|
||||||
$head[$tab][1] = $langs->trans("Info");
|
$head[$tab][1] = $langs->trans("Info");
|
||||||
|
|||||||
@ -152,7 +152,7 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
|
|||||||
// if we're in a directory and we want recursive behavior, call this function again
|
// if we're in a directory and we want recursive behavior, call this function again
|
||||||
if ($recursive)
|
if ($recursive)
|
||||||
{
|
{
|
||||||
$file_list = array_merge($file_list,dol_dir_list($path."/".$file, $types, $recursive, $filter, $excludefilter, $sortcriteria, $sortorder, $mode));
|
$file_list = array_merge($file_list,dol_dir_list($path."/".$file, $types, $recursive, $filter, $excludefilter, $sortcriteria, $sortorder, $mode, $nohook));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (! $isdir && (($types == "files") || ($types == "all")))
|
else if (! $isdir && (($types == "files") || ($types == "all")))
|
||||||
|
|||||||
@ -547,161 +547,3 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $
|
|||||||
|
|
||||||
return $imgThumbName;
|
return $imgThumbName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns the html for the moneymeter.
|
|
||||||
*
|
|
||||||
* @param int $actualValue amount of actual money
|
|
||||||
* @param int $pendingValue amount of money of pending memberships
|
|
||||||
* @param int $intentValue amount of intended money (that's without the amount of actual money)
|
|
||||||
* @return string thermometer htmlLegenda
|
|
||||||
*/
|
|
||||||
function moneyMeter($actualValue=0, $pendingValue=0, $intentValue=0)
|
|
||||||
{
|
|
||||||
global $langs;
|
|
||||||
|
|
||||||
// variables
|
|
||||||
$height="200";
|
|
||||||
$maximumValue=125000;
|
|
||||||
|
|
||||||
$imageDir = "http://eucd.info/images/therm/";
|
|
||||||
|
|
||||||
$imageTop = $imageDir . "therm_top.png";
|
|
||||||
$imageMiddleActual = $imageDir . "therm_actual.png";
|
|
||||||
$imageMiddlePending = $imageDir . "therm_pending.png";
|
|
||||||
$imageMiddleIntent = $imageDir . "therm_intent.png";
|
|
||||||
$imageMiddleGoal = $imageDir . "therm_goal.png";
|
|
||||||
$imageIndex = $imageDir . "therm_index.png";
|
|
||||||
$imageBottom = $imageDir . "therm_bottom.png";
|
|
||||||
$imageColorActual = $imageDir . "therm_color_actual.png";
|
|
||||||
$imageColorPending = $imageDir . "therm_color_pending.png";
|
|
||||||
$imageColorIntent = $imageDir . "therm_color_intent.png";
|
|
||||||
|
|
||||||
$formThermTop = '
|
|
||||||
<!-- Thermometer Begin -->
|
|
||||||
<table cellpadding="0" cellspacing="4" border="0">
|
|
||||||
<tr><td>
|
|
||||||
<table cellpadding="0" cellspacing="0" border="0">
|
|
||||||
<tr>
|
|
||||||
<td colspan="2"><img src="' . $imageTop . '" width="58" height="6" border="0"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<table cellpadding="0" cellspacing="0" border="0">';
|
|
||||||
|
|
||||||
$formSection = '
|
|
||||||
<tr><td><img src="{image}" width="26" height="{height}" border="0"></td></tr>';
|
|
||||||
|
|
||||||
$formThermbottom = '
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
<td><img src="' . $imageIndex . '" width="32" height="200" border="0"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2"><img src="' . $imageBottom . '" width="58" height="32" border="0"></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr></table>';
|
|
||||||
|
|
||||||
// legenda
|
|
||||||
|
|
||||||
$legendaActual = "€ " . round($actualValue);
|
|
||||||
$legendaPending = "€ " . round($pendingValue);
|
|
||||||
$legendaIntent = "€ " . round($intentValue);
|
|
||||||
$legendaTotal = "€ " . round($actualValue + $pendingValue + $intentValue);
|
|
||||||
$formLegenda = '
|
|
||||||
|
|
||||||
<table cellpadding="0" cellspacing="0" border="0">
|
|
||||||
<tr><td><img src="' . $imageColorActual . '" width="9" height="9"> </td><td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>'.$langs->trans("Paid").':<br>' . $legendaActual . '</b></font></td></tr>
|
|
||||||
<tr><td><img src="' . $imageColorPending . '" width="9" height="9"> </td><td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">'.$langs->trans("Waiting").':<br>' . $legendaPending . '</font></td></tr>
|
|
||||||
<tr><td><img src="' . $imageColorIntent . '" width="9" height="9"> </td><td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">'.$langs->trans("Promesses").':<br>' . $legendaIntent . '</font></td></tr>
|
|
||||||
<tr><td> </td><td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Total:<br>' . $legendaTotal . '</font></td></tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<!-- Thermometer End -->';
|
|
||||||
|
|
||||||
// check and edit some values
|
|
||||||
|
|
||||||
$error = 0;
|
|
||||||
if ( $maximumValue <= 0 || $height <= 0 || $actualValue < 0 || $pendingValue < 0 || $intentValue < 0)
|
|
||||||
{
|
|
||||||
return "The money meter could not be processed<br>\n";
|
|
||||||
}
|
|
||||||
if ( $actualValue > $maximumValue )
|
|
||||||
{
|
|
||||||
$actualValue = $maximumValue;
|
|
||||||
$pendingValue = 0;
|
|
||||||
$intentValue = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( ($actualValue + $pendingValue) > $maximumValue )
|
|
||||||
{
|
|
||||||
$pendingValue = $maximumValue - $actualValue;
|
|
||||||
$intentValue = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( ($actualValue + $pendingValue + $intentValue) > $maximumValue )
|
|
||||||
{
|
|
||||||
$intentValue = $maximumValue - $actualValue - $pendingValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// start writing the html (from bottom to top)
|
|
||||||
|
|
||||||
// bottom
|
|
||||||
$thermometer = $formThermbottom;
|
|
||||||
|
|
||||||
// actual
|
|
||||||
$sectionHeight = round(($actualValue / $maximumValue) * $height);
|
|
||||||
$totalHeight = $sectionHeight;
|
|
||||||
if ( $sectionHeight > 0 )
|
|
||||||
{
|
|
||||||
$section = $formSection;
|
|
||||||
$section = str_replace("{image}", $imageMiddleActual, $section);
|
|
||||||
$section = str_replace("{height}", $sectionHeight, $section);
|
|
||||||
$thermometer = $section . $thermometer;
|
|
||||||
}
|
|
||||||
|
|
||||||
// pending
|
|
||||||
$sectionHeight = round(($pendingValue / $maximumValue) * $height);
|
|
||||||
$totalHeight += $sectionHeight;
|
|
||||||
if ( $sectionHeight > 0 )
|
|
||||||
{
|
|
||||||
$section = $formSection;
|
|
||||||
$section = str_replace("{image}", $imageMiddlePending, $section);
|
|
||||||
$section = str_replace("{height}", $sectionHeight, $section);
|
|
||||||
$thermometer = $section . $thermometer;
|
|
||||||
}
|
|
||||||
|
|
||||||
// intent
|
|
||||||
$sectionHeight = round(($intentValue / $maximumValue) * $height);
|
|
||||||
$totalHeight += $sectionHeight;
|
|
||||||
if ( $sectionHeight > 0 )
|
|
||||||
{
|
|
||||||
$section = $formSection;
|
|
||||||
$section = str_replace("{image}", $imageMiddleIntent, $section);
|
|
||||||
$section = str_replace("{height}", $sectionHeight, $section);
|
|
||||||
$thermometer = $section . $thermometer;
|
|
||||||
}
|
|
||||||
|
|
||||||
// goal
|
|
||||||
$sectionHeight = $height- $totalHeight;
|
|
||||||
if ( $sectionHeight > 0 )
|
|
||||||
{
|
|
||||||
$section = $formSection;
|
|
||||||
$section = str_replace("{image}", $imageMiddleGoal, $section);
|
|
||||||
$section = str_replace("{height}", $sectionHeight, $section);
|
|
||||||
$thermometer = $section . $thermometer;
|
|
||||||
}
|
|
||||||
|
|
||||||
// top
|
|
||||||
$thermometer = $formThermTop . $thermometer;
|
|
||||||
|
|
||||||
return $thermometer . $formLegenda;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@ -241,7 +241,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
|
|
||||||
$pdf->SetXY($this->marge_gauche, $tab_top + 5);
|
$pdf->SetXY($this->marge_gauche, $tab_top + 5);
|
||||||
$text=$object->description;
|
$text=$object->description;
|
||||||
if ($object->duree > 0)
|
if ($object->duration > 0)
|
||||||
{
|
{
|
||||||
$totaltime=convertSecondToTime($object->duration,'all',$conf->global->MAIN_DURATION_OF_WORKDAY);
|
$totaltime=convertSecondToTime($object->duration,'all',$conf->global->MAIN_DURATION_OF_WORKDAY);
|
||||||
$text.=($text?' - ':'').$langs->trans("Total").": ".$totaltime;
|
$text.=($text?' - ':'').$langs->trans("Total").": ".$totaltime;
|
||||||
@ -436,9 +436,9 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||||
$pdf->SetXY($this->marge_gauche, $tab_top + 8);
|
$pdf->SetXY($this->marge_gauche, $tab_top + 8);
|
||||||
$text=$object->description;
|
$text=$object->description;
|
||||||
if ($object->duree > 0)
|
if ($object->duration > 0)
|
||||||
{
|
{
|
||||||
$totaltime=convertSecondToTime($object->duree,'all',$conf->global->MAIN_DURATION_OF_WORKDAY);
|
$totaltime=convertSecondToTime($object->duration,'all',$conf->global->MAIN_DURATION_OF_WORKDAY);
|
||||||
$text.=($text?' - ':'').$langs->trans("Total").": ".$totaltime;
|
$text.=($text?' - ':'').$langs->trans("Total").": ".$totaltime;
|
||||||
}
|
}
|
||||||
$desc=dol_htmlentitiesbr($text,1);
|
$desc=dol_htmlentitiesbr($text,1);
|
||||||
|
|||||||
@ -1530,7 +1530,7 @@ else if ($id || $ref)
|
|||||||
{
|
{
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref, '/').'([^\-])+');
|
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
|
|
||||||
// Define output language
|
// Define output language
|
||||||
@ -1557,7 +1557,7 @@ else if ($id || $ref)
|
|||||||
dol_print_error($db,$result);
|
dol_print_error($db,$result);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref, '/').'([^\-])+');
|
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -160,7 +160,7 @@ else if ($action == 'confirm_modify' && $confirm == 'yes' && $user->rights->fich
|
|||||||
else if ($action == 'add' && $user->rights->ficheinter->creer)
|
else if ($action == 'add' && $user->rights->ficheinter->creer)
|
||||||
{
|
{
|
||||||
$object->socid = $socid;
|
$object->socid = $socid;
|
||||||
$object->duree = GETPOST('duree','int');
|
$object->duration = GETPOST('duration','int');
|
||||||
$object->fk_project = GETPOST('projectid','int');
|
$object->fk_project = GETPOST('projectid','int');
|
||||||
$object->fk_contrat = GETPOST('contratid','int');
|
$object->fk_contrat = GETPOST('contratid','int');
|
||||||
$object->author = $user->id;
|
$object->author = $user->id;
|
||||||
@ -1256,7 +1256,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
// Duration
|
// Duration
|
||||||
print '<tr><td>'.$langs->trans("TotalDuration").'</td>';
|
print '<tr><td>'.$langs->trans("TotalDuration").'</td>';
|
||||||
print '<td colspan="3">'.convertSecondToTime($object->duree, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).'</td>';
|
print '<td colspan="3">'.convertSecondToTime($object->duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1755,7 +1755,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
|
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
|
|
||||||
// Define output language
|
// Define output language
|
||||||
@ -1782,7 +1782,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
dol_print_error($db,$result);
|
dol_print_error($db,$result);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
|
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,7 @@ class Fichinter extends CommonObject
|
|||||||
var $datec;
|
var $datec;
|
||||||
var $datev;
|
var $datev;
|
||||||
var $datem;
|
var $datem;
|
||||||
var $duree;
|
var $duration;
|
||||||
var $statut; // 0=draft, 1=validated, 2=invoiced
|
var $statut; // 0=draft, 1=validated, 2=invoiced
|
||||||
var $description;
|
var $description;
|
||||||
var $note_private;
|
var $note_private;
|
||||||
@ -116,7 +116,7 @@ class Fichinter extends CommonObject
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (! is_numeric($this->duree)) $this->duree = 0;
|
if (! is_numeric($this->duration)) $this->duration = 0;
|
||||||
|
|
||||||
if ($this->socid <= 0)
|
if ($this->socid <= 0)
|
||||||
{
|
{
|
||||||
@ -234,8 +234,8 @@ class Fichinter extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function update($user, $notrigger=0)
|
function update($user, $notrigger=0)
|
||||||
{
|
{
|
||||||
if (! is_numeric($this->duree)) {
|
if (! is_numeric($this->duration)) {
|
||||||
$this->duree = 0;
|
$this->duration = 0;
|
||||||
}
|
}
|
||||||
if (! dol_strlen($this->fk_project)) {
|
if (! dol_strlen($this->fk_project)) {
|
||||||
$this->fk_project = 0;
|
$this->fk_project = 0;
|
||||||
@ -245,7 +245,7 @@ class Fichinter extends CommonObject
|
|||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter SET ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter SET ";
|
||||||
$sql.= "description = '".$this->db->escape($this->description)."'";
|
$sql.= "description = '".$this->db->escape($this->description)."'";
|
||||||
$sql.= ", duree = ".$this->duree;
|
$sql.= ", duree = ".$this->duration;
|
||||||
$sql.= ", fk_projet = ".$this->fk_project;
|
$sql.= ", fk_projet = ".$this->fk_project;
|
||||||
$sql.= ", note_private = ".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null");
|
$sql.= ", note_private = ".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null");
|
||||||
$sql.= ", note_public = ".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null");
|
$sql.= ", note_public = ".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null");
|
||||||
@ -306,7 +306,7 @@ class Fichinter extends CommonObject
|
|||||||
$this->description = $obj->description;
|
$this->description = $obj->description;
|
||||||
$this->socid = $obj->fk_soc;
|
$this->socid = $obj->fk_soc;
|
||||||
$this->statut = $obj->fk_statut;
|
$this->statut = $obj->fk_statut;
|
||||||
$this->duree = $obj->duree;
|
$this->duration = $obj->duree;
|
||||||
$this->datec = $this->db->jdate($obj->datec);
|
$this->datec = $this->db->jdate($obj->datec);
|
||||||
$this->datev = $this->db->jdate($obj->datev);
|
$this->datev = $this->db->jdate($obj->datev);
|
||||||
$this->datem = $this->db->jdate($obj->datem);
|
$this->datem = $this->db->jdate($obj->datem);
|
||||||
@ -951,7 +951,7 @@ class Fichinter extends CommonObject
|
|||||||
$this->datec = $now;
|
$this->datec = $now;
|
||||||
$this->note_private='Private note';
|
$this->note_private='Private note';
|
||||||
$this->note_public='SPECIMEN';
|
$this->note_public='SPECIMEN';
|
||||||
$this->duree = 0;
|
$this->duration = 0;
|
||||||
$nbp = 25;
|
$nbp = 25;
|
||||||
$xnbp = 0;
|
$xnbp = 0;
|
||||||
while ($xnbp < $nbp)
|
while ($xnbp < $nbp)
|
||||||
@ -964,7 +964,7 @@ class Fichinter extends CommonObject
|
|||||||
$this->lines[$xnbp]=$line;
|
$this->lines[$xnbp]=$line;
|
||||||
$xnbp++;
|
$xnbp++;
|
||||||
|
|
||||||
$this->duree+=$line->duration;
|
$this->duration+=$line->duration;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2265,7 +2265,7 @@ elseif (! empty($object->id))
|
|||||||
{
|
{
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
|
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
|
|
||||||
// Define output language
|
// Define output language
|
||||||
@ -2292,7 +2292,7 @@ elseif (! empty($object->id))
|
|||||||
dol_print_error($db,$result);
|
dol_print_error($db,$result);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
|
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,8 @@
|
|||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2015 juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2015 juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Abbes Bahfir <bafbes@gmail.com>
|
* Copyright (C) 2015 Abbes Bahfir <bafbes@gmail.com>
|
||||||
|
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||||
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
@ -74,8 +75,12 @@ $search_company = GETPOST("search_company","alpha");
|
|||||||
$search_amount_no_tax = GETPOST("search_amount_no_tax","alpha");
|
$search_amount_no_tax = GETPOST("search_amount_no_tax","alpha");
|
||||||
$search_amount_all_tax = GETPOST("search_amount_all_tax","alpha");
|
$search_amount_all_tax = GETPOST("search_amount_all_tax","alpha");
|
||||||
$search_status=GETPOST('search_status','alpha');
|
$search_status=GETPOST('search_status','alpha');
|
||||||
|
$day = GETPOST("day","int");
|
||||||
$month = GETPOST("month","int");
|
$month = GETPOST("month","int");
|
||||||
$year = GETPOST("year","int");
|
$year = GETPOST("year","int");
|
||||||
|
$day_lim = GETPOST('day_lim','int');
|
||||||
|
$month_lim = GETPOST('month_lim','int');
|
||||||
|
$year_lim = GETPOST('year_lim','int');
|
||||||
$filter = GETPOST("filtre");
|
$filter = GETPOST("filtre");
|
||||||
|
|
||||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers
|
||||||
@ -163,15 +168,30 @@ if ($search_ref_supplier)
|
|||||||
}
|
}
|
||||||
if ($month > 0)
|
if ($month > 0)
|
||||||
{
|
{
|
||||||
if ($year > 0)
|
if ($year > 0 && empty($day))
|
||||||
$sql.= " AND fac.datef BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
|
$sql.= " AND fac.datef 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 fac.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'";
|
||||||
else
|
else
|
||||||
$sql.= " AND date_format(fac.datef, '%m') = '$month'";
|
$sql.= " AND date_format(fac.datef, '%m') = '".$month."'";
|
||||||
}
|
}
|
||||||
else if ($year > 0)
|
else if ($year > 0)
|
||||||
{
|
{
|
||||||
$sql.= " AND fac.datef BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
$sql.= " AND fac.datef BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
||||||
}
|
}
|
||||||
|
if ($month_lim > 0)
|
||||||
|
{
|
||||||
|
if ($year_lim > 0 && empty($day_lim))
|
||||||
|
$sql.= " AND fac.date_lim_reglement BETWEEN '".$db->idate(dol_get_first_day($year_lim,$month_lim,false))."' AND '".$db->idate(dol_get_last_day($year_lim,$month_lim,false))."'";
|
||||||
|
else if ($year_lim > 0 && ! empty($day_lim))
|
||||||
|
$sql.= " AND fac.date_lim_reglement BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_lim, $day_lim, $year_lim))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month_lim, $day_lim, $year_lim))."'";
|
||||||
|
else
|
||||||
|
$sql.= " AND date_format(fac.date_lim_reglement, '%m') = '".$month_lim."'";
|
||||||
|
}
|
||||||
|
else if ($year_lim > 0)
|
||||||
|
{
|
||||||
|
$sql.= " AND fac.datef BETWEEN '".$db->idate(dol_get_first_day($year_lim,1,false))."' AND '".$db->idate(dol_get_last_day($year_lim,12,false))."'";
|
||||||
|
}
|
||||||
if ($search_label)
|
if ($search_label)
|
||||||
{
|
{
|
||||||
$sql .= natural_search('fac.libelle', $search_label);
|
$sql .= natural_search('fac.libelle', $search_label);
|
||||||
@ -260,11 +280,15 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '<td class="liste_titre" colspan="1" align="center">';
|
print '<td class="liste_titre" colspan="1" align="center">';
|
||||||
|
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.'">';
|
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
|
||||||
$syear = $year;
|
$formother->select_year($year?$year:-1,'year',1, 20, 5);
|
||||||
$formother->select_year($syear?$syear:-1,'year',1, 20, 5);
|
print '</td>';
|
||||||
|
print '<td class="liste_titre" colspan="1" align="center">';
|
||||||
|
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day_lim" value="'.$day_lim.'">';
|
||||||
|
print '<input class="flat" type="text" size="1" maxlength="2" name="month_lim" value="'.$month_lim.'">';
|
||||||
|
$formother->select_year($year_lim?$year_lim:-1,'year_lim',1, 20, 5);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre"> </td>';
|
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat" size="16" type="text" name="search_label" value="'.$search_label.'">';
|
print '<input class="flat" size="16" type="text" name="search_label" value="'.$search_label.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user