Beispiel #1
0
    // 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();
Beispiel #2
0
if ($what) {
    if ($errormsg) {
        print '<div class="error">' . $langs->trans("Error") . " : " . $errormsg . '</div>';
        //		print '<a href="'.DOL_URL_ROOT.$relativepatherr.'">'.$langs->trans("DownloadErrorFile").'</a><br>';
        print '<br>';
        print '<br>';
    } else {
        print '<div class="ok">';
        print $langs->trans("BackupFileSuccessfullyCreated") . '.<br>';
        print $langs->trans("YouCanDownloadBackupFile");
        print '</div>';
        print '<br>';
    }
}
$filearray = dol_dir_list($conf->admin->dir_output . '/backup', 'files', 0, '', '', $sortfield, strtolower($sortorder) == 'asc' ? SORT_ASC : SORT_DESC, 1);
$result = $formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'backup/', 1, 0, $langs->trans("NoBackupFileAvailable") . '<br>' . $langs->trans("ToBuildBackupFileClickHere", DOL_URL_ROOT . '/admin/tools/dolibarr_export.php'), 0, $langs->trans("PreviousDumpFiles"));
print '<br>';
$time_end = time();
llxFooter();
$db->close();
// MYSQL NO BINARIES (only php)
/**	Backup the db OR just a table without mysqldump binary (does not require any exec permission)
 *	Author: David Walsh (http://davidwalsh.name/backup-mysql-database-php)
 *	Updated and enhanced by Stephen Larroque (lrq3000) and by the many commentators from the blog
 *	Note about foreign keys constraints: for Dolibarr, since there are a lot of constraints and when imported the tables will be inserted in the dumped order, not in constraints order, then we ABSOLUTELY need to use SET FOREIGN_KEY_CHECKS=0; when importing the sql dump.
 *	Note2: db2SQL by Howard Yeend can be an alternative, by using SHOW FIELDS FROM and SHOW KEYS FROM we could generate a more precise dump (eg: by getting the type of the field and then precisely outputting the right formatting - in quotes, numeric or null - instead of trying to guess like we are doing now).
 *
 *	@param	string	$outputfile		Output file name
 *	@param	string	$tables			Table name or '*' for all
 *	@return	int						<0 if KO, >0 if OK
 */
Beispiel #3
0
		 * Confirmation suppression fichier
		 */
		if ($action == 'delete')
		{
			$ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$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.'/commande/document.php?id='.$object->id,'',0,0,$user->rights->commande->creer);


		// 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');
}

$db->close();

llxFooter('$Date: 2011/07/31 22:23:15 $ - $Revision: 1.36 $');
?>
        print ' <label for="' . $val['id'] . '">' . $val['label'] . '</label>';
    } else {
        print '<input type="radio" name="compression" value="' . $key . '" id="' . $val['id'] . '" disabled="disabled">';
        print ' <label for="' . $val['id'] . '">' . $val['label'] . '</label>';
        print ' (' . $langs->trans("NotAvailable") . ')';
    }
    print ' &nbsp; &nbsp; ';
}
print '</div>';
print "\n";
?>
</fieldset>

<br>
<div align="center"><input type="submit" class="button"
	value="<?php 
echo $langs->trans("GenerateBackup");
?>
" id="buttonGo" /><br>
<br>
</div>


</form>

<?php 
$filearray = dol_dir_list($conf->admin->dir_output . '/backup', 'files', 0, '', '', $sortfield, strtolower($sortorder) == 'asc' ? SORT_ASC : SORT_DESC, 1);
$result = $formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'backup/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousDumpFiles"));
print '<br>';
llxFooter();
$db->close();
Beispiel #5
0
	print "</table>\n";

	dol_fiche_end();

	print '<br>';

	dol_htmloutput_mesg($mesg);


	// Affiche formulaire upload
	$formfile=new FormFile($db);
	$formfile->form_attach_new_file(DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.($withproject?'&withproject=1':''),'',0,0,$user->rights->projet->creer,50,$object);


	// List of document
	$param='&id='.$object->id;
	$formfile->list_of_documents($filearray,$object,'projet',$param,0,dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref).'/');
}
else
{
	Header('Location: index.php');
	exit;
}


llxFooter();

$db->close();
?>
Beispiel #6
0
	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();
?>
Beispiel #7
0
print "</table></form>";
//print $langs->trans("ECMSectionAutoDesc");



print '</td><td valign="top">';

// Right area
$relativepath=$ecmdir->getRelativePath();
$upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
$filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);

$formfile=new FormFile($db);
$param='&amp;section='.$section;
$textifempty=($section?$langs->trans("NoFileFound"):$langs->trans("ECMSelectASection"));
$formfile->list_of_documents($filearray,'','ecm',$param,1,$relativepath,$user->rights->ecm->upload,1,$textifempty);

//	print '<table width="100%" class="border">';

//	print '<tr><td> </td></tr></table>';



print '</td></tr>';

print '</table>';


print '<br>';

// End of page
Beispiel #8
0
		 */
		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");
}

$db->close();

llxFooter('$Date: 2011/07/31 22:23:13 $ - $Revision: 1.46 $');
Beispiel #9
0
	// 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 $');
?>
Beispiel #10
0
    // Societe
    print '<tr><td>'.$langs->trans("Customer").'</td>';
    print '<td colspan="3">'.$soc->getNomUrl(1).'</td></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>';

    print '</div>';


    // Affiche formulaire upload
   	$formfile=new FormFile($db);
	$formfile->form_attach_new_file(DOL_URL_ROOT.'/contrat/document.php?id='.$contrat->id,'',0,0,$user->rights->contrat->creer);


	// List of document
	$param='&id='.$contrat->id;
	$formfile->list_of_documents($filearray,$contrat,'contract',$param);

}
else
{
	print $langs->trans("UnkownError");
}

$db->close();

llxFooter('$Date: 2011/07/31 23:46:55 $ - $Revision: 1.25 $');
?>
Beispiel #11
0
	// 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/document.php?id='.$project->id,'',0,0,$user->rights->projet->creer);


	// List of document
	$param='&id='.$project->id;
	$formfile->list_of_documents($filearray,$project,'projet',$param);

}
else
{
	Header('Location: index.php');
}

$db->close();

llxFooter('$Date: 2011/07/31 23:23:36 $ - $Revision: 1.14 $');
?>
Beispiel #12
0
	// Files infos
	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);


	// Affiche formulaire upload
	$formfile=new FormFile($db);
	$formfile->form_attach_new_file(DOL_URL_ROOT.'/projet/document.php?id='.$object->id,'',0,0,($userWrite>0),50,$object);


	// List of document
	$param='&id='.$object->id;
	$formfile->list_of_documents($filearray,$object,'projet',$param,0,'',($userWrite>0));

}
else
{
	dol_print_error('','NoRecordFound');
}

llxFooter();

$db->close();
?>
Beispiel #13
0
		 */
		if ($_GET['action'] == 'delete')
		{
			$ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$_GET["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.'/adherents/document.php?id='.$id,'',0,0,$user->rights->adherent->creer);


		// List of document
		$param='&socid='.$societe->id;
		$formfile->list_of_documents($filearray,$member,'member',$param, 0, get_exdir($id,2,0,1).'/'.$id.'/');

		print "<br><br>";
	}
	else
	{
		dol_print_error($db);
	}
}
else
{
    $langs->load("errors");
	print $langs->trans("ErrorRecordNotFound");
}

$db->close();
Beispiel #14
0
		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.'/fourn/facture/document.php?facid='.$facture->id,'',0,0,$user->rights->fournisseur->facture->creer);


		// List of document
		$param='&facid='.$facture->id;
		$formfile->list_of_documents($filearray,$facture,'facture_fournisseur',$param,0,get_exdir($facture->id,2,0).$facture->id.'/');

	}
	else
	{
		print 'facid='.$facid.'<br>';
		dol_print_error($db);
	}
}
else
{
	print $langs->trans('UnkownError');
}

$db->close();
Beispiel #15
0
	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 $');
?>
Beispiel #16
0
        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();
Beispiel #17
0
    print '<td width="30%">' . $langs->trans("Ref") . '</td><td colspan="3">';
    print $form->showrefnav($object, 'ref', '', 1, 'ref');
    print '</td>';
    print '</tr>';
    // Label
    print '<tr><td>' . $langs->trans("Label") . '</td><td colspan="3">' . $object->adresse . '</td></tr>';
    /*
    	// Status (to sell)
    	print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td>';
    	print $object->getLibStatut(2,0);
    	print '</td></tr>';
    
    	// 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 . '/gestimmo/biens/document.php?id=' . $object->id, '', 0, 0, $user->rights->produit->creer || $user->rights->service->creer, 50, $object);
    // List of document
    $formfile->list_of_documents($filearray, $object, 'gestimmo');
} else {
    print $langs->trans("UnkownError");
}
llxFooter();
$db->close();
Beispiel #18
0
	/*
	 * Confirmation suppression fichier
	 */
	if ($action == 'delete')
	{
		$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
		if ($ret == 'html') print '<br>';
	}

	$formfile=new FormFile($db);

	// Show upload form
	$formfile->form_attach_new_file($_SERVER["PHP_SELF"].'?id='.$object->id,'',0,0,$user->rights->societe->creer,50,$object);

	// List of document
	$param='&socid='.$object->id;
	$formfile->list_of_documents($filearray,$object,'societe',$param);

	print "<br><br>";
}
else
{
	accessforbidden('',0,0);
}


llxFooter();
$db->close();
?>
Beispiel #19
0
    if (!in_array($basedir, $listdir)) {
        print img_warning($langs->trans('WarningSafeModeOnCheckExecDir'));
        dol_syslog("safe_mode is on, basedir is " . $basedir . ", safe_mode_exec_dir is " . ini_get('safe_mode_exec_dir'), LOG_WARNING);
    }
}
print '<input type="text" name="MAIN_ANTIVIRUS_COMMAND" size="72" value="' . (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? dol_htmlentities($conf->global->MAIN_ANTIVIRUS_COMMAND) : '') . '">';
print "</td>";
print '</tr>';
// Use anti virus
$var = !$var;
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="' . (!empty($conf->global->MAIN_ANTIVIRUS_PARAM) ? dol_htmlentities($conf->global->MAIN_ANTIVIRUS_PARAM) : '') . '">';
print "</td>";
print '</tr>';
print '</table>';
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" name="button" value="' . $langs->trans("Modify") . '"></div>';
print '</form>';
// Form to test upload
print '<br>';
$formfile = new FormFile($db);
$formfile->form_attach_new_file($_SERVER['PHP_SELF'], $langs->trans("FormToTestFileUploadForm"), 0, 0, 1, 50, '', '', 1, '', 0);
// List of document
$filearray = dol_dir_list($upload_dir, "files", 0, '', '', 'name', SORT_ASC, 1);
$formfile->list_of_documents($filearray, '', 'admin_temp', '');
llxFooter();
$db->close();
Beispiel #20
0
    // Ref
    print '<tr><td width="30%">' . $langs->trans("Ref") . '</td><td>';
    print $form->showrefnav($object, 'ref', '', 1, 'ref', 'ref');
    print '</td></tr>';
    // Societe
    print "<tr><td>" . $langs->trans("Company") . "</td><td>" . $object->client->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>';
    print '</div>';
    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 . '/fichinter/document.php?id=' . $object->id, '', 0, 0, $user->rights->ficheinter->creer, 50, $object);
    // List of document
    $param = '&id=' . $object->id;
    $formfile->list_of_documents($filearray, $object, 'ficheinter', $param);
} else {
    print $langs->trans("UnkownError");
}
llxFooter();
$db->close();
Beispiel #21
0
 */
llxheader('', $langs->trans("adddocument"), '');
$form = new Form($db);
if ($object->id) {
    $locataire = new Locataire($db, GETPOST('id'));
    $head = locataire_prepare_head($locataire);
    dol_fiche_head($head, 'document', $langs->trans("ImoDocument"), 0, 'renter');
    // 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 '<table class="border" width="100%">';
    print '<tr><td width="20%">' . $langs->trans("nomlocataire") . '</td>';
    print '<td><input name="nom" size="40" value="' . $locataire->nom . '"</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($_SERVER["PHP_SELF"] . '?id=' . $object->id, '', 0, 0, 1, 50, $locataire);
    // List of document
    // $param='&id='.$object->id;
    $formfile->list_of_documents($filearray, $object, 'immobilier/locataire', $param);
} else {
    print $langs->trans("UnkownError");
}
llxFooter();
$db->close();
 * 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>";
Beispiel #23
0
        // Status
        print '<tr><td valign="top">' . $langs->trans("Status") . '</td>';
        print '<td colspan="3">' . $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>\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 . '/compta/bank/document.php?id=' . $object->id, '', 0, 0, $user->rights->banque, 50, $object);
        // List of document
        $param = '&id=' . $object->id;
        $formfile->list_of_documents($filearray, $object, 'bank', $param);
    } else {
        dol_print_error($db);
    }
} else {
    Header('Location: index.php');
}
llxFooter();
$db->close();
Beispiel #24
0
$filearray = dol_dir_list($upload_dir, "files", 0, '\\.odt', '\\.meta$', $sortfield, strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC, 1);
$totalsize = 0;
foreach ($filearray as $key => $file) {
    $totalsize += $file['size'];
}
print '<table class="border"width="100%">';
// Nbre fichiers
print '<tr><td>' . $langs->trans("NbOfAttachedFiles") . '</td><td colspan="3">' . count($filearray) . '</td></tr>';
//Total taille
print '<tr><td>' . $langs->trans("TotalSizeOfAttachedFiles") . '</td><td colspan="3">' . $totalsize . ' ' . $langs->trans("bytes") . '</td></tr>';
print '</table>';
print '</div>';
dol_htmloutput_mesg($mesg, $mesgs);
/*
 * Confirmation suppression fichier
 */
if ($action == 'delete') {
    $ret = $form->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
$formfile->form_attach_new_file($_SERVER["PHP_SELF"] . '?socid=' . $socid, '', 0, 0, $user->rights->societe->creer, 50, $object);
// List of document
$param = '&socid=' . $object->id;
$formfile->list_of_documents($filearray, $object, 'modelcontract', $param);
print "<br><br>";
$db->close();
llxFooter();