25 require
'../../../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
33 $langs->loadLangs(array(
"compta",
"banks",
"bills",
"users",
"accountancy"));
37 $action =
GETPOST(
'action',
'aZ09');
38 $confirm =
GETPOST(
'confirm',
'alpha');
41 $socid =
GETPOST(
"socid",
"int");
42 if ($user->socid) $socid = $user->socid;
46 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
47 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
48 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
50 if (empty($page) || $page == -1) { $page = 0; }
51 $offset = $limit * $page;
52 $pageprev = $page - 1;
53 $pagenext = $page + 1;
54 if (!$sortorder) $sortorder =
"ASC";
55 if (!$sortfield) $sortfield =
"name";
59 $object->fetch($id, $ref);
62 $modulepart =
'banque';
69 include_once DOL_DOCUMENT_ROOT.
'/core/actions_linkedfiles.inc.php';
76 $form =
new Form($db);
78 $title = $langs->trans(
"VariousPayment").
' - '.$langs->trans(
"Documents");
88 $morehtmlref =
'<div class="refidno">';
90 if (!empty($conf->projet->enabled))
92 $langs->load(
"projects");
93 $morehtmlref .= $langs->trans(
'Project').
' : ';
94 if ($user->rights->banque->modifier && 0)
96 if ($action !=
'classify') {
97 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> : ';
99 if ($action ==
'classify') {
101 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
102 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
103 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
104 $morehtmlref .= $formproject->select_projects(0, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
105 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
106 $morehtmlref .=
'</form>';
108 $morehtmlref .= $form->form_project(
$_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
111 if (!empty($object->fk_project)) {
113 $proj->fetch($object->fk_project);
114 $morehtmlref .= $proj->getNomUrl(1);
120 $morehtmlref .=
'</div>';
121 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/various_payment/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
123 dol_banner_tab($object,
'id', $linkback, 1,
'rowid',
'ref', $morehtmlref,
'', 0,
'', $morehtmlright);
125 print '<div class="fichecenter">';
126 print '<div class="underbanner clearboth"></div>';
129 $filearray =
dol_dir_list($upload_dir,
"files", 0,
'',
'(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) ==
'desc' ?SORT_DESC:SORT_ASC), 1);
131 foreach ($filearray as $key => $file)
133 $totalsize += $file[
'size'];
136 print '<table class="border tableforfield centpercent">';
138 print '<tr><td class="titlefield">'.$langs->trans(
"NbOfAttachedFiles").
'</td><td colspan="3">'.count($filearray).
'</td></tr>';
139 print '<tr><td>'.$langs->trans(
"TotalSizeOfAttachedFiles").
'</td><td colspan="3">'.$totalsize.
' '.$langs->trans(
"bytes").
'</td></tr>';
144 print '<div class="clearboth"></div>';
148 $modulepart =
'banque';
149 $permission = $user->rights->banque->modifier;
150 $param =
'&id='.$object->id;
151 include_once DOL_DOCUMENT_ROOT.
'/core/tpl/document_actions_post_headers.tpl.php';
153 print $langs->trans(
"ErrorUnknown");
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
img_edit($titlealt= 'default', $float=0, $other= '')
Show logo editer/modifier fiche.
Class to manage various payments.
various_payment_prepare_head($object)
Prepare array with list of tabs.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
Class to manage projects.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_banner_tab($object, $paramid, $morehtml= '', $shownav=1, $fieldid= 'rowid', $fieldref= 'ref', $morehtmlref= '', $moreparam= '', $nodbprefix=0, $morehtmlleft= '', $morehtmlstatus= '', $onlybanner=0, $morehtmlright= '')
Show tab footer of a card.