本文整理汇总了PHP中FormFile::form_attach_new_file方法的典型用法代码示例。如果您正苦于以下问题:PHP FormFile::form_attach_new_file方法的具体用法?PHP FormFile::form_attach_new_file怎么用?PHP FormFile::form_attach_new_file使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormFile
的用法示例。
在下文中一共展示了FormFile::form_attach_new_file方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FormFile
if ($action == 'delete')
{
$ret=$html->form_confirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
}
$formfile=new FormFile($db);
// Show upload form
if ($conf->global->MAIN_USE_JQUERY_FILEUPLOAD)
{
$formfile->form_ajaxfileupload($object);
}
else
{
$formfile->form_attach_new_file($_SERVER["PHP_SELF"].'?socid='.$socid,'',0,0,$user->rights->societe->creer);
}
// List of document
$param='&socid='.$object->id;
$formfile->list_of_documents($filearray,$object,'societe',$param);
print "<br><br>";
}
else
{
dol_print_error($db);
}
}
else
{
示例2: FormFile
<div class="pane-in ecm-in-layout-south layout-padding valignmiddle">
<?php
// Start Add new file area
// To attach new file
if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS) || !empty($section)) {
if (empty($section) || $section == -1) {
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#formuserfile').hide();
});
</script>
<?php
}
$formfile = new FormFile($db);
$formfile->form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, $section ? $section : -1, $user->rights->ecm->upload, 48, null, '', 0, '', 0, 'formuserfile');
} else {
print ' ';
}
// End Add new file area
?>
</div>
</div>
</div> <!-- end div id="containerlayout" -->
<?php
// End of page
//dol_fiche_end();
if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) {
include DOL_DOCUMENT_ROOT . '/ecm/tpl/enablefiletreeajax.tpl.php';
}
llxFooter();
示例3: FormFile
if (!empty($conf->global->MAIN_UPLOAD_DOC)) {
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=ajout_photo&id=' . $object->id . '">';
print $langs->trans("AddPhoto") . '</a>';
} else {
print '<a class="butActionRefused" href="#">e';
print $langs->trans("AddPhoto") . '</a>';
}
}
print "\n</div>\n";
/*
* Add a photo
*/
if ($action == 'ajout_photo' && ($user->rights->produit->creer || $user->rights->service->creer) && !empty($conf->global->MAIN_UPLOAD_DOC)) {
// Affiche formulaire upload
$formfile = new FormFile($db);
$formfile->form_attach_new_file($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans("AddPhoto"), 1, 0, $user->rights->produit->creer || $user->rights->service->creer, 50, $object, '', false, '', 0);
// ajax=false for the moment. true may not work.
}
// Affiche photos
if ($action != 'ajout_photo') {
$nbphoto = 0;
$nbbyrow = 5;
$maxWidth = 160;
$maxHeight = 120;
print $object->show_photos($dir, 1, 1000, $nbbyrow, 1, 1);
if ($object->nbphoto < 1) {
print '<br>';
print '<table width="100%" valign="top" align="center" border="0" cellpadding="2" cellspacing="2">';
print '<tr align=center valign=middle border=1><td class="photo">';
print "<br>" . $langs->trans("NoPhotoYet") . "<br><br>";
print '</td></tr>';
示例4: FormFile
// Status (to buy)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td>';
print $object->getLibStatut(2,1);
print '</td></tr>';
print '<tr><td>'.$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>';
print '</div>';
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/product/document.php?id='.$object->id,'',0,0,($user->rights->produit->creer||$user->rights->service->creer),50,$object);
// List of document
$param='&id='.$object->id;
$formfile->list_of_documents($filearray,$object,'produit',$param);
}
else
{
print $langs->trans("UnkownError");
}
llxFooter();
$db->close();
示例5: htmlentities
print '<td align="right">';
print '<input type="submit" class="button" name="button" value="' . $langs->trans("Modify") . '">';
print '</td>';
print '</tr>';
print '</form>';
// Use anti virus
$var = !$var;
print '<form action="' . $_SERVER["PHP_SELF"] . '?action=MAIN_ANTIVIRUS_PARAM" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print "<tr " . $bc[$var] . ">";
print '<td colspan="2">' . $langs->trans("AntiVirusParam") . '<br>';
print $langs->trans("AntiVirusParamExample");
print '</td>';
print '<td>';
print '<input type="text" name="MAIN_ANTIVIRUS_PARAM" size="72" value="' . htmlentities($conf->global->MAIN_ANTIVIRUS_PARAM) . '">';
print "</td>";
print '<td align="right">';
print '<input type="submit" class="button" name="button" value="' . $langs->trans("Modify") . '">';
print '</td>';
print '</tr>';
print '</form>';
print '</table>';
print '</div>';
// Form to test upload
dol_htmloutput_mesg($mesg);
// Affiche formulaire upload
print '<br>';
$formfile = new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT . '/admin/security_other.php', $langs->trans("FormToTestFileUploadForm"), 0, 0, 1);
llxFooter();
$db->close();
示例6: FormFile
print '<tr><td>'.$langs->trans("AuthorRequest").'</td>';
print '<td colspan="2">'.$author->getNomUrl(1).'</td>';
print '</tr>';
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.sizeof($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";
if ($mesg) { print $mesg."<br>"; }
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/fourn/commande/document.php?id='.$commande->id,'',0,0,$user->rights->fournisseur->commande->creer);
// List of document
$param='&id='.$commande->id;
$formfile->list_of_documents($filearray,$commande,'commande_fournisseur',$param);
}
else
{
Header('Location: index.php');
}
$db->close();
llxFooter('$Date: 2011/07/31 23:57:02 $ - $Revision: 1.24 $');
?>
示例7: FormFile
dol_htmloutput_mesg($mesg,$mesgs);
/*
* Confirmation suppression fichier
*/
if ($action == 'delete')
{
$ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$id.'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
}
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id,'',0,0,$user->rights->facture->creer);
// List of document
$param='&facid='.$object->id;
$formfile->list_of_documents($filearray,$object,'facture',$param);
}
else
{
dol_print_error($db);
}
}
else
{
print $langs->trans("UnkownError");
示例8: count
print $form->showrefnav($object, 'ref', '', 1, 'ref', 'ref');
print '</td></tr>';
print '<tr><td>' . $langs->trans('Company') . '</td><td colspan="3">' . $object->thirdparty->getNomUrl(1) . '</td></tr>';
print '<tr><td>' . $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";
dol_htmloutput_mesg($mesg, $mesgs);
/*
* Confirmation suppression fichier
*/
if ($action == 'delete') {
$ret = $form->form_confirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') {
print '<br>';
}
}
// Affiche formulaire upload
$formfile = new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT . '/commande/document.php?id=' . $object->id, '', 0, 0, $user->rights->commande->creer, 50, $object);
// List of document
$param = '&id=' . $object->id;
$formfile->list_of_documents($filearray, $object, 'commande', $param);
} else {
dol_print_error($db);
}
} else {
Header('Location: index.php');
}
llxFooter();
$db->close();
示例9: price
print dol_print_date($object->periode, "day");
}
print "</td>";
print "</tr>";
// Due date
if ($action == 'edit') {
print '<tr><td>' . $langs->trans("DateDue") . "</td><td>";
print $form->select_date($object->date_ech, 'ech', 0, 0, 0, 'charge', 1);
print "</td></tr>";
} else {
print "<tr><td>" . $langs->trans("DateDue") . "</td><td>" . dol_print_date($object->date_ech, 'day') . "</td></tr>";
}
// Amount
print '<tr><td>' . $langs->trans("AmountTTC") . '</td><td>' . price($object->amount) . '</td></tr>';
// Status
print '<tr><td>' . $langs->trans("Status") . '</td><td>' . $object->getLibStatut(4) . '</td></tr>';
print '<tr><td>' . $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>';
print '</div>';
// Affiche formulaire upload
$formfile = new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT . '/compta/sociales/document.php?id=' . $object->id, '', 0, 0, $user->rights->tax->charges->creer);
// List of document
//$param='&id='.$object->id;
$formfile->list_of_documents($filearray, $object, 'tax', $param);
} else {
print $langs->trans("UnkownError");
}
llxFooter();
$db->close();
示例10: FormFile
?>
">
<div class="pane-in ecm-in-layout-center">
<div id="ecmfileview" class="ecmfileview">
<?php
// Start right panel
$mode = 'noajax';
include_once DOL_DOCUMENT_ROOT . '/core/ajax/ajaxdirpreview.php';
// End right panel
?>
</div>
</div>
<div class="pane-in ecm-in-layout-south layout-padding valignmiddle">
<?php
// Start Add new file area
// To attach new file
if (empty($conf->global->MAIN_ECM_DISABLE_JS) || !empty($section)) {
$formfile = new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT . '/ecm/index.php', 'none', 0, $section ? $section : -1, $user->rights->ecm->upload, 48);
} else {
print ' ';
}
// End Add new file area
?>
</div>
</div>
</div> <!-- end div id="containerlayout" -->
<?php
// End of page
llxFooter();
$db->close();
示例11: urlencode
* Confirm form to delete
*/
if ($action == 'delete') {
$langs->load("companies");
// Need for string DeleteFile+ConfirmDeleteFiles
$ret = $form->form_confirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int') . (empty($param) ? '' : $param), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') {
print '<br>';
}
}
$formfile = new FormFile($db);
// We define var to enable the feature to add prefix of uploaded files
$savingdocmask = '';
if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX)) {
//var_dump($modulepart);
if (in_array($modulepart, array('facture_fournisseur', 'commande_fournisseur', 'facture', 'commande', 'propal', 'ficheinter', 'contract', 'project', 'project_task'))) {
$savingdocmask = $object->ref . '___file__';
}
/*if (in_array($modulepart,array('member')))
{
$savingdocmask=$object->login.'___file__';
}*/
}
// Show upload form (document and links)
$formfile->form_attach_new_file($_SERVER["PHP_SELF"] . '?id=' . $object->id . (empty($withproject) ? '' : '&withproject=1'), '', 0, 0, $permission, 50, $object, '', 1, $savingdocmask);
// List of document
$formfile->list_of_documents($filearray, $object, $modulepart, $param, 0, $relativepathwithnofile, $permission);
print "<br>";
//List of links
$formfile->listOfLinks($object, $permission, $action, GETPOST('linkid', 'int'), $param);
print "<br>";
示例12: FormFile
else print ' ';
print '</td></tr>';
// Files infos
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.sizeof($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";
if ($mesg) { print $mesg."<br>"; }
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/projet/tasks/document.php?id='.$task->id,'',0,0,$user->rights->projet->creer);
// List of document
$param='&id='.$task->id;
$formfile->list_of_documents($filearray,$task,'projet',$param,0,dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($task->ref).'/');
}
else
{
Header('Location: index.php');
}
$db->close();
llxFooter('$Date: 2011/07/31 23:23:36 $ - $Revision: 1.16 $');
示例13: FormFile
{
print '<a class="butActionRefused" href="#">e';
print $langs->trans("AddPhoto").'</a>';
}
}
print "\n</div>\n";
/*
* Add a photo
*/
if ($_GET["action"] == 'ajout_photo' && ($user->rights->produit->creer || $user->rights->service->creer) && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/product/photos.php?id='.$product->id,$langs->trans("AddPhoto"),1);
}
// Affiche photos
if ($_GET["action"] != 'ajout_photo')
{
$nbphoto=0;
$nbbyrow=5;
$maxWidth = 160;
$maxHeight = 120;
print $product->show_photos($dir,1,1000,$nbbyrow,1,1);
if ($product->nbphoto < 1)
{
示例14: strtolower
print '<tr><td nowrap>' . $langs->trans("Priority") . '</td><td colspan="3">';
print $act->priority ? $act->priority : '';
print '</td></tr>';
print '</table><br><br><table class="border" width="100%">';
// Construit liste des fichiers
$filearray = dol_dir_list($upload_dir, "files", 0, '', '\\.meta$', $sortfield, strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC, 1);
$totalsize = 0;
foreach ($filearray as $key => $file) {
$totalsize += $file['size'];
}
print '<tr><td width="30%" nowrap>' . $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>';
print '</div>';
if ($mesg) {
print $mesg . "<br>";
}
// Affiche formulaire upload
$formfile = new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT . '/comm/action/document.php?id=' . $act->id, '', 0, 0, $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create);
// List of document
$param = '&id=' . $act->id;
$formfile->list_of_documents($filearray, $act, 'actions', $param, 0, '', $user->rights->agenda->myactions->create);
} else {
dol_print_error($db);
}
} else {
print $langs->trans("UnkownError");
}
$db->close();
llxFooter();
示例15: FactureFournisseur
// FIXME $facidnext is not defined
/*
if ($facidnext > 0)
{
$facthatreplace=new FactureFournisseur($db);
$facthatreplace->fetch($facidnext);
print ' ('.$langs->transnoentities("ReplacedByInvoice",$facthatreplace->getNomUrl(1)).')';
}
*/
print '</td></tr>';
// Label
print '<tr><td>' . $form->editfieldkey("Label", 'label', $object->label, $object, 0) . '</td><td colspan="3">';
print $form->editfieldval("Label", 'label', $object->label, $object, 0);
print '</td>';
// Nb of files
print '<tr><td>' . $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>';
print '</div>';
// Affiche formulaire upload
$formfile = new FormFile($db);
$formfile->form_attach_new_file($_SERVER['PHP_SELF'] . '?facid=' . $object->id, '', 0, 0, $user->rights->fournisseur->facture->creer, 50, $object);
// List of document
$param = '&facid=' . $object->id;
$ref = dol_sanitizeFileName($object->ref);
$formfile->list_of_documents($filearray, $object, 'facture_fournisseur', $param, 0, get_exdir($object->id, 2, 0) . $ref . '/');
} else {
print $langs->trans('UnkownError');
}
llxFooter();
$db->close();