Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into dev_manageextrafieldswithmultientity
This commit is contained in:
commit
f6a1e7685c
@ -275,6 +275,8 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
|||||||
$refcomp=$societestatic->getNomUrl(1,'',24);
|
$refcomp=$societestatic->getNomUrl(1,'',24);
|
||||||
|
|
||||||
$paiement = $facturestatic->getSommePaiement(); // Payment already done
|
$paiement = $facturestatic->getSommePaiement(); // Payment already done
|
||||||
|
$paiement+= $facturestatic->getSumDepositsUsed();
|
||||||
|
$paiement+= $facturestatic->getSumCreditNotesUsed();
|
||||||
}
|
}
|
||||||
if ($obj->family == 'social_contribution')
|
if ($obj->family == 'social_contribution')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -28,9 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
|||||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
||||||
|
|
||||||
$langs->load("compta");
|
$langs->loadLangs(array("compta","banks","bills","accountancy"));
|
||||||
$langs->load("banks");
|
|
||||||
$langs->load("bills");
|
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST("socid","int");
|
$socid = GETPOST("socid","int");
|
||||||
@ -43,7 +41,8 @@ $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
|||||||
$search_ref = GETPOST('search_ref','int');
|
$search_ref = GETPOST('search_ref','int');
|
||||||
$search_user = GETPOST('search_user','alpha');
|
$search_user = GETPOST('search_user','alpha');
|
||||||
$search_label = GETPOST('search_label','alpha');
|
$search_label = GETPOST('search_label','alpha');
|
||||||
$search_amount = GETPOST('search_amount','alpha');
|
$search_amount_deb = GETPOST('search_amount_deb','alpha');
|
||||||
|
$search_amount_cred = GETPOST('search_amount_cred','alpha');
|
||||||
$search_account = GETPOST('search_account','int');
|
$search_account = GETPOST('search_account','int');
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
@ -77,7 +76,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
|||||||
{
|
{
|
||||||
$search_ref="";
|
$search_ref="";
|
||||||
$search_label="";
|
$search_label="";
|
||||||
$search_amount="";
|
$search_amount_deb="";
|
||||||
|
$search_amount_cred="";
|
||||||
$search_account='';
|
$search_account='';
|
||||||
$typeid="";
|
$typeid="";
|
||||||
}
|
}
|
||||||
@ -104,7 +104,8 @@ $sql.= " WHERE v.entity = ".$conf->entity;
|
|||||||
// Search criteria
|
// Search criteria
|
||||||
if ($search_ref) $sql.=" AND v.rowid=".$search_ref;
|
if ($search_ref) $sql.=" AND v.rowid=".$search_ref;
|
||||||
if ($search_label) $sql.=natural_search(array('v.label'), $search_label);
|
if ($search_label) $sql.=natural_search(array('v.label'), $search_label);
|
||||||
if ($search_amount) $sql.=natural_search("v.amount", $search_amount, 1);
|
if ($search_amount_deb) $sql.=natural_search("v.amount", $search_amount_deb, 1);
|
||||||
|
if ($search_amount_cred) $sql.=natural_search("v.amount", $search_amount_cred, 1);
|
||||||
if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account;
|
if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account;
|
||||||
if ($filtre) {
|
if ($filtre) {
|
||||||
$filtre=str_replace(":","=",$filtre);
|
$filtre=str_replace(":","=",$filtre);
|
||||||
@ -158,8 +159,8 @@ if ($result)
|
|||||||
print_liste_field_titre("PaymentMode",$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
|
print_liste_field_titre("PaymentMode",$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
|
||||||
if (! empty($conf->banque->enabled)) print_liste_field_titre("BankAccount",$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
if (! empty($conf->banque->enabled)) print_liste_field_titre("BankAccount",$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre("AccountAccounting",$_SERVER["PHP_SELF"],"v.accountancy_code","",$param,'align="left"',$sortfield,$sortorder);
|
print_liste_field_titre("AccountAccounting",$_SERVER["PHP_SELF"],"v.accountancy_code","",$param,'align="left"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre("Debit",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre("Sens",$_SERVER["PHP_SELF"],"v.sens","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre("Credit",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@ -192,11 +193,11 @@ if ($result)
|
|||||||
// Accounting account
|
// Accounting account
|
||||||
if (! empty($conf->accounting->enabled)) print '<td class="liste_titre"> </td>';
|
if (! empty($conf->accounting->enabled)) print '<td class="liste_titre"> </td>';
|
||||||
|
|
||||||
// Amount
|
// Debit
|
||||||
print '<td class="liste_titre" align="right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>';
|
print '<td class="liste_titre" align="right"><input name="search_amount_deb" class="flat" type="text" size="8" value="'.$search_amount_deb.'"></td>';
|
||||||
|
|
||||||
// Sens
|
// Credit
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre" align="right"><input name="search_amount_cred" class="flat" type="text" size="8" value="'.$search_amount_cred.'"></td>';
|
||||||
|
|
||||||
print '<td class="liste_titre" align="right">';
|
print '<td class="liste_titre" align="right">';
|
||||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||||
@ -205,6 +206,7 @@ if ($result)
|
|||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$totalarray=array();
|
||||||
while ($i < min($num,$limit))
|
while ($i < min($num,$limit))
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
@ -241,7 +243,7 @@ if ($result)
|
|||||||
|
|
||||||
$accountingjournal = new AccountingJournal($db);
|
$accountingjournal = new AccountingJournal($db);
|
||||||
$accountingjournal->fetch($obj->accountancy_journal);
|
$accountingjournal->fetch($obj->accountancy_journal);
|
||||||
$accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1);
|
$accountstatic->accountancy_journal = $accountingjournal->code;
|
||||||
}
|
}
|
||||||
|
|
||||||
$accountstatic->label=$obj->blabel;
|
$accountstatic->label=$obj->blabel;
|
||||||
@ -259,16 +261,25 @@ if ($result)
|
|||||||
print '<td>'.$accountingaccount->getNomUrl(0,1,1,'',1).'</td>';
|
print '<td>'.$accountingaccount->getNomUrl(0,1,1,'',1).'</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Amount
|
// Debit
|
||||||
print "<td align=\"right\">".price($obj->amount)."</td>";
|
print "<td align=\"right\">";
|
||||||
|
if ($obj->sens == 0)
|
||||||
|
{
|
||||||
|
print price($obj->amount);
|
||||||
|
$totalarray['totaldeb'] += $obj->amount;
|
||||||
|
}
|
||||||
|
print "</td>";
|
||||||
|
|
||||||
|
// Credit
|
||||||
|
print "<td align=\"right\">";
|
||||||
|
if ($obj->sens == 1)
|
||||||
|
{
|
||||||
|
print price($obj->amount);
|
||||||
|
$totalarray['totalcred'] += $obj->amount;
|
||||||
|
}
|
||||||
|
print "</td>";
|
||||||
|
|
||||||
// Sens
|
|
||||||
if ($obj->sens == '1') $sens = $langs->trans("Credit"); else $sens = $langs->trans("Debit");
|
|
||||||
print "<td align=\"right\">".$sens."</td>";
|
|
||||||
print "<td></td>";
|
print "<td></td>";
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
$total = $total + $obj->amount;
|
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -277,7 +288,8 @@ if ($result)
|
|||||||
if (! empty($conf->banque->enabled)) $colspan++;
|
if (! empty($conf->banque->enabled)) $colspan++;
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td colspan="'.$colspan.'" class="liste_total">'.$langs->trans("Total").'</td>';
|
print '<td colspan="'.$colspan.'" class="liste_total">'.$langs->trans("Total").'</td>';
|
||||||
print '<td class="liste_total" align="right">'.price($total)."</td>";
|
print '<td class="liste_total" align="right">'.price($totalarray['totaldeb'])."</td>";
|
||||||
|
print '<td class="liste_total" align="right">'.price($totalarray['totalcred'])."</td>";
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("compta");
|
$langs->load("compta");
|
||||||
@ -334,7 +334,7 @@ if ($resql)
|
|||||||
|
|
||||||
$accountingjournal = new AccountingJournal($db);
|
$accountingjournal = new AccountingJournal($db);
|
||||||
$accountingjournal->fetch($objp->accountancy_journal);
|
$accountingjournal->fetch($objp->accountancy_journal);
|
||||||
$accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1);
|
$accountstatic->accountancy_journal = $accountingjournal->code;
|
||||||
|
|
||||||
print $accountstatic->getNomUrl(1);
|
print $accountstatic->getNomUrl(1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2045,7 +2045,7 @@ else
|
|||||||
if ($user->rights->contrat->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid">'.$langs->trans("Validate").'</a></div>';
|
if ($user->rights->contrat->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid">'.$langs->trans("Validate").'</a></div>';
|
||||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Validate").'</a></div>';
|
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Validate").'</a></div>';
|
||||||
}
|
}
|
||||||
if ($object->statut == 1 && $nbofservices)
|
if ($object->statut == 1)
|
||||||
{
|
{
|
||||||
if ($user->rights->contrat->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("Modify").'</a></div>';
|
if ($user->rights->contrat->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("Modify").'</a></div>';
|
||||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Modify").'</a></div>';
|
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Modify").'</a></div>';
|
||||||
|
|||||||
@ -223,7 +223,7 @@ if ($mode == "5") $sql.= " AND cd.statut = 5";
|
|||||||
if ($filter == "expired") $sql.= " AND cd.date_fin_validite < '".$db->idate($now)."'";
|
if ($filter == "expired") $sql.= " AND cd.date_fin_validite < '".$db->idate($now)."'";
|
||||||
if ($filter == "notexpired") $sql.= " AND cd.date_fin_validite >= '".$db->idate($now)."'";
|
if ($filter == "notexpired") $sql.= " AND cd.date_fin_validite >= '".$db->idate($now)."'";
|
||||||
if ($search_name) $sql.= " AND s.nom LIKE '%".$db->escape($search_name)."%'";
|
if ($search_name) $sql.= " AND s.nom LIKE '%".$db->escape($search_name)."%'";
|
||||||
if ($search_contract) $sql.= " AND c.rowid = '".$db->escape($search_contract)."'";
|
if ($search_contract) $sql.= " AND c.ref LIKE '%".$db->escape($search_contract)."%' ";
|
||||||
if ($search_service) $sql.= " AND (p.ref LIKE '%".$db->escape($search_service)."%' OR p.description LIKE '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')";
|
if ($search_service) $sql.= " AND (p.ref LIKE '%".$db->escape($search_service)."%' OR p.description LIKE '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')";
|
||||||
if ($socid > 0) $sql.= " AND s.rowid = ".$socid;
|
if ($socid > 0) $sql.= " AND s.rowid = ".$socid;
|
||||||
$filter_dateouvertureprevue=dol_mktime(0,0,0,$opouvertureprevuemonth,$opouvertureprevueday,$opouvertureprevueyear);
|
$filter_dateouvertureprevue=dol_mktime(0,0,0,$opouvertureprevuemonth,$opouvertureprevueday,$opouvertureprevueyear);
|
||||||
|
|||||||
@ -32,7 +32,6 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
|
|||||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
|
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
|
||||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||||
|
|
||||||
|
|
||||||
if (! isset($mode) || $mode != 'noajax') // For ajax call
|
if (! isset($mode) || $mode != 'noajax') // For ajax call
|
||||||
{
|
{
|
||||||
require_once '../../main.inc.php';
|
require_once '../../main.inc.php';
|
||||||
@ -45,6 +44,7 @@ if (! isset($mode) || $mode != 'noajax') // For ajax call
|
|||||||
$section=GETPOST("section");
|
$section=GETPOST("section");
|
||||||
$module=GETPOST("module");
|
$module=GETPOST("module");
|
||||||
$urlsource=GETPOST("urlsource");
|
$urlsource=GETPOST("urlsource");
|
||||||
|
$search_doc_ref=GETPOST('search_doc_ref','alpha');
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
@ -188,12 +188,16 @@ if ($type == 'directory')
|
|||||||
if (in_array($module, $automodules))
|
if (in_array($module, $automodules))
|
||||||
{
|
{
|
||||||
$param.='&module='.$module;
|
$param.='&module='.$module;
|
||||||
|
if (isset($search_doc_ref) && $search_doc_ref != '') $param.='&search_doc_ref='.$search_doc_ref;
|
||||||
|
|
||||||
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound")));
|
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound")));
|
||||||
|
|
||||||
if ($module == 'company') $excludefiles[]='^contact$'; // The subdir 'contact' contains files of contacts with no id of thirdparty.
|
if ($module == 'company') $excludefiles[]='^contact$'; // The subdir 'contact' contains files of contacts with no id of thirdparty.
|
||||||
|
|
||||||
$filearray=dol_dir_list($upload_dir,"files",1,'', $excludefiles, $sortfield, $sorting,1);
|
$filter=preg_quote($search_doc_ref, '/');
|
||||||
$formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url);
|
$filearray=dol_dir_list($upload_dir, "files", 1, $filter, $excludefiles, $sortfield, $sorting,1);
|
||||||
|
|
||||||
|
$formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url,1);
|
||||||
}
|
}
|
||||||
// Manual list
|
// Manual list
|
||||||
else
|
else
|
||||||
@ -211,6 +215,8 @@ if ($type == 'directory')
|
|||||||
if ($section)
|
if ($section)
|
||||||
{
|
{
|
||||||
$param.='§ion='.$section;
|
$param.='§ion='.$section;
|
||||||
|
if (isset($search_doc_ref) && $search_doc_ref != '') $param.='&search_doc_ref='.$search_doc_ref;
|
||||||
|
|
||||||
$textifempty = $langs->trans('NoFileFound');
|
$textifempty = $langs->trans('NoFileFound');
|
||||||
}
|
}
|
||||||
else if ($section === '0') $textifempty='<br><div align="center"><font class="warning">'.$langs->trans("DirNotSynchronizedSyncFirst").'</font></div><br>';
|
else if ($section === '0') $textifempty='<br><div align="center"><font class="warning">'.$langs->trans("DirNotSynchronizedSyncFirst").'</font></div><br>';
|
||||||
|
|||||||
@ -835,9 +835,9 @@ class FormFile
|
|||||||
$out='';
|
$out='';
|
||||||
$this->infofiles=array('nboffiles'=>0,'extensions'=>array(),'files'=>array());
|
$this->infofiles=array('nboffiles'=>0,'extensions'=>array(),'files'=>array());
|
||||||
|
|
||||||
//if (! empty($conf->dol_use_jmobile)) return '';
|
$filterforfilesearch = preg_quote(basename($modulesubdir),'/').'[^\-]+';
|
||||||
|
|
||||||
$file_list=dol_dir_list($filedir, 'files', 0, preg_quote(basename($modulesubdir),'/').'[^\-]+', '\.meta$|\.png$'); // Get list of files starting with name of ref (but not followed by "-" to discard uploaded files)
|
$file_list=dol_dir_list($filedir, 'files', 0, $filterforfilesearch, '\.meta$|\.png$'); // Get list of files starting with name of ref (but not followed by "-" to discard uploaded files)
|
||||||
|
|
||||||
// For ajax treatment
|
// For ajax treatment
|
||||||
$out.= '<!-- html.formfile::getDocumentsLink -->'."\n";
|
$out.= '<!-- html.formfile::getDocumentsLink -->'."\n";
|
||||||
@ -922,9 +922,10 @@ class FormFile
|
|||||||
* @param string $sortfield Sort field ('name', 'size', 'position', ...)
|
* @param string $sortfield Sort field ('name', 'size', 'position', ...)
|
||||||
* @param string $sortorder Sort order ('ASC' or 'DESC')
|
* @param string $sortorder Sort order ('ASC' or 'DESC')
|
||||||
* @param int $disablemove 1=Disable move button, 0=Position move is possible.
|
* @param int $disablemove 1=Disable move button, 0=Position move is possible.
|
||||||
|
* @param int $addfilterfields Add line with filters
|
||||||
* @return int <0 if KO, nb of files shown if OK
|
* @return int <0 if KO, nb of files shown if OK
|
||||||
*/
|
*/
|
||||||
function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permonobject=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='', $showrelpart=0, $permtoeditline=-1,$upload_dir='',$sortfield='',$sortorder='ASC', $disablemove=1)
|
function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permonobject=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='', $showrelpart=0, $permtoeditline=-1,$upload_dir='',$sortfield='',$sortorder='ASC', $disablemove=1, $addfilterfields=0)
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs, $hookmanager;
|
global $user, $conf, $langs, $hookmanager;
|
||||||
global $bc,$bcdd;
|
global $bc,$bcdd;
|
||||||
@ -1006,6 +1007,18 @@ class FormFile
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table width="100%" id="tablelines" class="'.($useinecm?'liste noborder':'liste').'">'."\n";
|
print '<table width="100%" id="tablelines" class="'.($useinecm?'liste noborder':'liste').'">'."\n";
|
||||||
|
|
||||||
|
if (! empty($addfilterfields))
|
||||||
|
{
|
||||||
|
print '<tr class="liste_titre nodrag nodrop">';
|
||||||
|
print '<td><input type="search_doc_ref" value="'.dol_escape_htmltag(GETPOST('search_doc_ref','alpha')).'"></td>';
|
||||||
|
print '<td></td>';
|
||||||
|
print '<td></td>';
|
||||||
|
if (empty($useinecm)) print '<td></td>';
|
||||||
|
print '<td></td>';
|
||||||
|
if (! $disablemove) print '<td></td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
|
||||||
print '<tr class="liste_titre nodrag nodrop">';
|
print '<tr class="liste_titre nodrag nodrop">';
|
||||||
print_liste_field_titre('Documents2',$url,"name","",$param,'align="left"',$sortfield,$sortorder);
|
print_liste_field_titre('Documents2',$url,"name","",$param,'align="left"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre('Size',$url,"size","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre('Size',$url,"size","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
@ -1292,20 +1305,46 @@ class FormFile
|
|||||||
* @param int $textifempty Text to show if filearray is empty
|
* @param int $textifempty Text to show if filearray is empty
|
||||||
* @param int $maxlength Maximum length of file name shown
|
* @param int $maxlength Maximum length of file name shown
|
||||||
* @param string $url Full url to use for click links ('' = autodetect)
|
* @param string $url Full url to use for click links ('' = autodetect)
|
||||||
|
* @param int $addfilterfields Add line with filters
|
||||||
* @return int <0 if KO, nb of files shown if OK
|
* @return int <0 if KO, nb of files shown if OK
|
||||||
*/
|
*/
|
||||||
function list_of_autoecmfiles($upload_dir,$filearray,$modulepart,$param,$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='',$maxlength=0,$url='')
|
function list_of_autoecmfiles($upload_dir,$filearray,$modulepart,$param,$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='',$maxlength=0,$url='',$addfilterfields=0)
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs;
|
global $user, $conf, $langs, $form;
|
||||||
global $bc;
|
global $bc;
|
||||||
global $sortfield, $sortorder;
|
global $sortfield, $sortorder;
|
||||||
|
global $search_doc_ref;
|
||||||
|
|
||||||
dol_syslog(get_class($this).'::list_of_autoecmfiles upload_dir='.$upload_dir.' modulepart='.$modulepart);
|
dol_syslog(get_class($this).'::list_of_autoecmfiles upload_dir='.$upload_dir.' modulepart='.$modulepart);
|
||||||
|
|
||||||
// Show list of documents
|
// Show list of documents
|
||||||
if (empty($useinecm)) print load_fiche_titre($langs->trans("AttachedFiles"));
|
if (empty($useinecm)) print load_fiche_titre($langs->trans("AttachedFiles"));
|
||||||
if (empty($url)) $url=$_SERVER["PHP_SELF"];
|
if (empty($url)) $url=$_SERVER["PHP_SELF"];
|
||||||
|
|
||||||
|
if (! empty($addfilterfields))
|
||||||
|
{
|
||||||
|
print '<form action="'.$_SERVER['PHP_SELF'].'">';
|
||||||
|
print '<input type="hidden" name="module" value="'.$modulepart.'">';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table width="100%" class="noborder">'."\n";
|
print '<table width="100%" class="noborder">'."\n";
|
||||||
|
|
||||||
|
if (! empty($addfilterfields))
|
||||||
|
{
|
||||||
|
print '<tr class="liste_titre nodrag nodrop">';
|
||||||
|
print '<td><input type="text" class="maxwidth100onsmartphone" name="search_doc_ref" value="'.dol_escape_htmltag($search_doc_ref).'"></td>';
|
||||||
|
print '<td></td>';
|
||||||
|
print '<td></td>';
|
||||||
|
print '<td></td>';
|
||||||
|
// Action column
|
||||||
|
print '<td class="liste_titre" align="middle">';
|
||||||
|
$searchpicto=$form->showFilterButtons();
|
||||||
|
print $searchpicto;
|
||||||
|
print '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
$sortref="fullname";
|
$sortref="fullname";
|
||||||
if ($modulepart == 'invoice_supplier') $sortref='level1name';
|
if ($modulepart == 'invoice_supplier') $sortref='level1name';
|
||||||
@ -1449,20 +1488,23 @@ class FormFile
|
|||||||
|
|
||||||
if (! $found > 0 || ! is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) continue; // We do not show orphelins files
|
if (! $found > 0 || ! is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) continue; // We do not show orphelins files
|
||||||
|
|
||||||
|
|
||||||
print '<!-- Line list_of_autoecmfiles '.$key.' -->'."\n";
|
print '<!-- Line list_of_autoecmfiles '.$key.' -->'."\n";
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($found > 0 && is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) print $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]->getNomUrl(1,'document');
|
if ($found > 0 && is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) print $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]->getNomUrl(1,'document');
|
||||||
else print $langs->trans("ObjectDeleted",($id?$id:$ref));
|
else print $langs->trans("ObjectDeleted",($id?$id:$ref));
|
||||||
|
|
||||||
$filename=dol_sanitizeFileName($ref);
|
//$modulesubdir=dol_sanitizeFileName($ref);
|
||||||
|
$modulesubdir=dirname($relativefile);
|
||||||
|
|
||||||
//$filedir=$conf->$modulepart->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
//$filedir=$conf->$modulepart->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||||
$filedir=$file['path'];
|
$filedir=$file['path'];
|
||||||
//$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
//$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||||
//print $formfile->getDocumentsLink($modulepart, $filename, $filedir);
|
//print $formfile->getDocumentsLink($modulepart, $filename, $filedir);
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
// File
|
||||||
print '<td>';
|
print '<td>';
|
||||||
//print "XX".$file['name']; //$file['name'] must be utf8
|
//print "XX".$file['name']; //$file['name'] must be utf8
|
||||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart;
|
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart;
|
||||||
@ -1472,7 +1514,7 @@ class FormFile
|
|||||||
print dol_trunc($file['name'],$maxlength,'middle');
|
print dol_trunc($file['name'],$maxlength,'middle');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|
||||||
print $this->getDocumentsLink($modulepart, $filename, $filedir);
|
print $this->getDocumentsLink($modulepart, $modulesubdir, $filedir, '^'.preg_quote($file['name'],'/').'$');
|
||||||
|
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print '<td align="right">'.dol_print_size($file['size'],1,1).'</td>';
|
print '<td align="right">'.dol_print_size($file['size'],1,1).'</td>';
|
||||||
@ -1490,12 +1532,15 @@ class FormFile
|
|||||||
|
|
||||||
if (count($filearray) == 0)
|
if (count($filearray) == 0)
|
||||||
{
|
{
|
||||||
print '<tr '.$bc[false].'><td colspan="4">';
|
print '<tr '.$bc[false].'><td colspan="5">';
|
||||||
if (empty($textifempty)) print $langs->trans("NoFileFound");
|
if (empty($textifempty)) print $langs->trans("NoFileFound");
|
||||||
else print $textifempty;
|
else print $textifempty;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
if (! empty($addfilterfields)) print '</form>';
|
||||||
// Fin de zone
|
// Fin de zone
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -120,7 +120,7 @@ class Interfaces
|
|||||||
|
|
||||||
if (! $qualified)
|
if (! $qualified)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::run_triggers action=".$action." Triggers for file '".$file."' need module to be enabled", LOG_DEBUG);
|
//dol_syslog(get_class($this)."::run_triggers action=".$action." Triggers for file '".$file."' need module to be enabled", LOG_DEBUG);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2017 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
|
||||||
@ -419,7 +420,7 @@ function dol_get_next_week($day, $week, $month, $year)
|
|||||||
{
|
{
|
||||||
$tmparray = dol_get_first_day_week($day, $month, $year);
|
$tmparray = dol_get_first_day_week($day, $month, $year);
|
||||||
|
|
||||||
$time=dol_mktime(12,0,0,$month,$tmparray['first_day'],$year,1,0);
|
$time=dol_mktime(12,0,0,$tmparray['first_month'],$tmparray['first_day'],$tmparray['first_year'],1,0);
|
||||||
$time+=24*60*60*7;
|
$time+=24*60*60*7;
|
||||||
$tmparray=dol_getdate($time,true);
|
$tmparray=dol_getdate($time,true);
|
||||||
|
|
||||||
|
|||||||
@ -63,7 +63,7 @@ class modECM extends DolibarrModules
|
|||||||
$this->picto='dir';
|
$this->picto='dir';
|
||||||
|
|
||||||
// Data directories to create when module is enabled
|
// Data directories to create when module is enabled
|
||||||
$this->dirs = array("/ecm/My_First_Directory","/ecm/temp");
|
$this->dirs = array("/ecm/temp");
|
||||||
|
|
||||||
// Config pages. Put here list of php page names stored in admmin directory used to setup module
|
// Config pages. Put here list of php page names stored in admmin directory used to setup module
|
||||||
$this->config_page_url = array('ecm.php');
|
$this->config_page_url = array('ecm.php');
|
||||||
|
|||||||
@ -50,10 +50,11 @@ $result = restrictedArea($user, 'ecm', 0);
|
|||||||
// Get parameters
|
// Get parameters
|
||||||
$socid=GETPOST('socid','int');
|
$socid=GETPOST('socid','int');
|
||||||
$action=GETPOST('action','aZ09');
|
$action=GETPOST('action','aZ09');
|
||||||
$section=GETPOST("section")?GETPOST("section","int"):GETPOST("section_id","int");
|
$section=GETPOST('section','int')?GETPOST('section','int'):GETPOST('section_id','int');
|
||||||
$module=GETPOST("module");
|
$module=GETPOST('module','alpha');
|
||||||
if (! $section) $section=0;
|
if (! $section) $section=0;
|
||||||
$section_dir=GETPOST('section_dir');
|
$section_dir=GETPOST('section_dir','alpha');
|
||||||
|
$search_doc_ref=GETPOST('search_doc_ref','alpha');
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
@ -88,6 +89,12 @@ $error=0;
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Purge search criteria
|
||||||
|
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||||
|
{
|
||||||
|
$search_doc_ref='';
|
||||||
|
}
|
||||||
|
|
||||||
// Upload file
|
// Upload file
|
||||||
if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -10,7 +10,7 @@ CronSetup= Scheduled job management setup
|
|||||||
URLToLaunchCronJobs=URL to check and launch qualified cron jobs
|
URLToLaunchCronJobs=URL to check and launch qualified cron jobs
|
||||||
OrToLaunchASpecificJob=Or to check and launch a specific job
|
OrToLaunchASpecificJob=Or to check and launch a specific job
|
||||||
KeyForCronAccess=Security key for URL to launch cron jobs
|
KeyForCronAccess=Security key for URL to launch cron jobs
|
||||||
FileToLaunchCronJobs=Command line to launch cron jobs
|
FileToLaunchCronJobs=Command line to check and launch qualified cron jobs
|
||||||
CronExplainHowToRunUnix=On Unix environment you should use the following crontab entry to run the command line each 5 minutes
|
CronExplainHowToRunUnix=On Unix environment you should use the following crontab entry to run the command line each 5 minutes
|
||||||
CronExplainHowToRunWin=On Microsoft(tm) Windows environement you can use Scheduled task tools to run the command line each 5 minutes
|
CronExplainHowToRunWin=On Microsoft(tm) Windows environement you can use Scheduled task tools to run the command line each 5 minutes
|
||||||
CronMethodDoesNotExists=Class %s does not contains any method %s
|
CronMethodDoesNotExists=Class %s does not contains any method %s
|
||||||
|
|||||||
@ -443,8 +443,12 @@ class MyObject extends CommonObject
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
|
$this->output = '';
|
||||||
|
$this->error='';
|
||||||
|
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
|
// ...
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1172,6 +1172,9 @@ if ($action == 'edit_price' && $object->getRights()->creer)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
$parameters=array('colspan' => 2);
|
||||||
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|||||||
BIN
htdocs/theme/eldy/img/object_stripe.png
Normal file
BIN
htdocs/theme/eldy/img/object_stripe.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 819 B |
BIN
htdocs/theme/md/img/object_stripe.png
Normal file
BIN
htdocs/theme/md/img/object_stripe.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 819 B |
Loading…
Reference in New Issue
Block a user