本文整理汇总了PHP中dol_dir_list函数的典型用法代码示例。如果您正苦于以下问题:PHP dol_dir_list函数的具体用法?PHP dol_dir_list怎么用?PHP dol_dir_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dol_dir_list函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tax_prepare_head
/**
* Prepare array with list of tabs
*
* @param ChargeSociales $object Object related to tabs
* @return array Array of tabs to show
*/
function tax_prepare_head(ChargeSociales $object)
{
global $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT . '/compta/sociales/charges.php?id=' . $object->id;
$head[$h][1] = $langs->trans('Card');
$head[$h][2] = 'card';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'tax');
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$upload_dir = $conf->tax->dir_output . "/" . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
$head[$h][0] = DOL_URL_ROOT . '/compta/sociales/document.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Documents");
if ($nbFiles > 0) {
$head[$h][1] .= ' <span class="badge">' . $nbFiles . '</span>';
}
$head[$h][2] = 'documents';
$h++;
$head[$h][0] = DOL_URL_ROOT . '/compta/sociales/info.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'tax', 'remove');
return $head;
}
示例2: fichinter_prepare_head
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to show
*/
function fichinter_prepare_head($object)
{
global $langs, $conf, $user;
$langs->load("fichinter");
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT . '/fichinter/card.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
$head[$h][0] = DOL_URL_ROOT . '/fichinter/contact.php?id=' . $object->id;
$head[$h][1] = $langs->trans('InterventionContact');
$head[$h][2] = 'contact';
$h++;
}
if (!empty($conf->global->MAIN_USE_PREVIEW_TABS)) {
$head[$h][0] = DOL_URL_ROOT . '/fichinter/apercu.php?id=' . $object->id;
$head[$h][1] = $langs->trans('Preview');
$head[$h][2] = 'preview';
$h++;
}
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention');
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
$nbNote = 0;
if (!empty($object->note_private)) {
$nbNote++;
}
if (!empty($object->note_public)) {
$nbNote++;
}
$head[$h][0] = DOL_URL_ROOT . '/fichinter/note.php?id=' . $object->id;
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) {
$head[$h][1] .= ' <span class="badge">' . $nbNote . '</span>';
}
$head[$h][2] = 'note';
$h++;
}
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$upload_dir = $conf->ficheinter->dir_output . "/" . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
$head[$h][0] = DOL_URL_ROOT . '/fichinter/document.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Documents");
if ($nbFiles > 0) {
$head[$h][1] .= ' <span class="badge">' . $nbFiles . '</span>';
}
$head[$h][2] = 'documents';
$h++;
$head[$h][0] = DOL_URL_ROOT . '/fichinter/info.php?id=' . $object->id;
$head[$h][1] = $langs->trans('Info');
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention', 'remove');
return $head;
}
示例3: holiday_prepare_head
/**
* Return array head with list of tabs to view object informations
*
* @param Object $object Holiday
* @return array head
*/
function holiday_prepare_head($object)
{
global $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT . '/holiday/card.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
// Attachments
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$upload_dir = $conf->holiday->multidir_output[$object->entity] . '/' . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
$head[$h][0] = DOL_URL_ROOT . '/holiday/document.php?id=' . $object->id;
$head[$h][1] = $langs->trans('Documents');
if ($nbFiles > 0) {
$head[$h][1] .= ' <span class="badge">' . $nbFiles . '</span>';
}
$head[$h][2] = 'documents';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'holiday');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'holiday', 'remove');
return $head;
}
示例4: donation_prepare_head
/**
* Prepare array with list of tabs
*
* @param Donation $object Donation
* @return array Array of tabs to show
*/
function donation_prepare_head($object)
{
global $db, $langs, $conf;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT . '/don/card.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation');
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
$upload_dir = $conf->don->dir_output . '/' . get_exdir($filename, 2, 0, 1, $object, 'donation') . '/' . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
$nbLinks = Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT . '/don/document.php?id=' . $object->id;
$head[$h][1] = $langs->trans('Documents');
if ($nbFiles + $nbLinks > 0) {
$head[$h][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>';
}
$head[$h][2] = 'documents';
$h++;
$head[$h][0] = DOL_URL_ROOT . '/don/info.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation', 'remove');
return $head;
}
示例5: contact_prepare_head
/**
* Prepare array with list of tabs
*
* @param Contact $object Object related to tabs
* @return array Array of tabs to show
*/
function contact_prepare_head(Contact $object)
{
global $db, $langs, $conf, $user;
$tab = 0;
$head = array();
$head[$tab][0] = DOL_URL_ROOT . '/contact/card.php?id=' . $object->id;
$head[$tab][1] = $langs->trans("Card");
$head[$tab][2] = 'card';
$tab++;
if (!empty($conf->ldap->enabled) && !empty($conf->global->LDAP_CONTACT_ACTIVE)) {
$langs->load("ldap");
$head[$tab][0] = DOL_URL_ROOT . '/contact/ldap.php?id=' . $object->id;
$head[$tab][1] = $langs->trans("LDAPCard");
$head[$tab][2] = 'ldap';
$tab++;
}
$head[$tab][0] = DOL_URL_ROOT . '/contact/perso.php?id=' . $object->id;
$head[$tab][1] = $langs->trans("PersonalInformations");
$head[$tab][2] = 'perso';
$tab++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $tab, 'contact');
// Notes
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
$nbNote = (empty($object->note_private) ? 0 : 1) + (empty($object->note_public) ? 0 : 1);
$head[$tab][0] = DOL_URL_ROOT . '/contact/note.php?id=' . $object->id;
$head[$tab][1] = $langs->trans("Note");
if ($nbNote > 0) {
$head[$tab][1] .= ' <span class="badge">' . $nbNote . '</span>';
}
$head[$tab][2] = 'note';
$tab++;
}
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
$upload_dir = $conf->societe->dir_output . "/contact/" . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
$nbLinks = Link::count($db, $object->element, $object->id);
$head[$tab][0] = DOL_URL_ROOT . '/contact/document.php?id=' . $object->id;
$head[$tab][1] = $langs->trans("Documents");
if ($nbFiles + $nbLinks > 0) {
$head[$tab][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>';
}
$head[$tab][2] = 'documents';
$tab++;
// Info
$head[$tab][0] = DOL_URL_ROOT . '/contact/info.php?id=' . $object->id;
$head[$tab][1] = $langs->trans("Info");
$head[$tab][2] = 'info';
$tab++;
complete_head_from_modules($conf, $langs, $object, $head, $tab, 'contact', 'remove');
return $head;
}
示例6: bank_prepare_head
/**
* Prepare array with list of tabs
*
* @param Account $object Object related to tabs
* @return array Array of tabs to show
*/
function bank_prepare_head(Account $object)
{
global $db, $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT . '/compta/bank/card.php?id=' . $object->id;
$head[$h][1] = $langs->trans("AccountCard");
$head[$h][2] = 'bankname';
$h++;
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/account.php?id=" . $object->id;
$head[$h][1] = $langs->trans("Transactions");
$head[$h][2] = 'journal';
$h++;
// if ($conf->global->MAIN_FEATURES_LEVEL >= 1)
// {
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/treso.php?account=" . $object->id;
$head[$h][1] = $langs->trans("PlannedTransactions");
$head[$h][2] = 'cash';
$h++;
// }
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/annuel.php?account=" . $object->id;
$head[$h][1] = $langs->trans("IOMonthlyReporting");
$head[$h][2] = 'annual';
$h++;
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/graph.php?account=" . $object->id;
$head[$h][1] = $langs->trans("Graph");
$head[$h][2] = 'graph';
$h++;
if ($object->courant != 2) {
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/releve.php?account=" . $object->id;
$head[$h][1] = $langs->trans("AccountStatements");
$head[$h][2] = 'statement';
$h++;
}
// Attached files
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
$upload_dir = $conf->bank->dir_output . "/" . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
$nbLinks = Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/document.php?account=" . $object->id;
$head[$h][1] = $langs->trans("Documents");
if ($nbFiles + $nbLinks > 0) {
$head[$h][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>';
}
$head[$h][2] = 'document';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank', 'remove');
return $head;
}
示例7: contract_prepare_head
/**
* Prepare array with list of tabs
*
* @param Contrat $object Object related to tabs
* @return array Array of tabs to show
*/
function contract_prepare_head(Contrat $object)
{
global $db, $langs, $conf;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT . '/contrat/card.php?id=' . $object->id;
$head[$h][1] = $langs->trans("ContractCard");
$head[$h][2] = 'card';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
$head[$h][0] = DOL_URL_ROOT . '/contrat/contact.php?id=' . $object->id;
$head[$h][1] = $langs->trans("ContactsAddresses");
$head[$h][2] = 'contact';
$h++;
}
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'contract');
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
$nbNote = 0;
if (!empty($object->note_private)) {
$nbNote++;
}
if (!empty($object->note_public)) {
$nbNote++;
}
$head[$h][0] = DOL_URL_ROOT . '/contrat/note.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Notes");
if ($nbNote > 0) {
$head[$h][1] .= ' <span class="badge">' . $nbNote . '</span>';
}
$head[$h][2] = 'note';
$h++;
}
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
$upload_dir = $conf->contrat->dir_output . "/" . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
$nbLinks = Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT . '/contrat/document.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Documents");
if ($nbFiles + $nbLinks > 0) {
$head[$h][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>';
}
$head[$h][2] = 'documents';
$h++;
$head[$h][0] = DOL_URL_ROOT . '/contrat/info.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'contract', 'remove');
return $head;
}
示例8: listDrivers
/**
* Return list of printing driver
*
* @param DoliDB $db Database handler
* @param integer $maxfilenamelength Max length of value to show
* @return array List of drivers
*/
static function listDrivers($db, $maxfilenamelength = 0)
{
global $conf;
$type = 'printing';
$list = array();
$moduledir = DOL_DOCUMENT_ROOT . "/core/modules/printing/";
$tmpfiles = dol_dir_list($moduledir, 'all', 0, '\\modules.php', '', 'name', SORT_ASC, 0);
foreach ($tmpfiles as $record) {
$list[$record['fullname']] = str_replace('.modules.php', '', $record['name']);
}
return $list;
}
示例9: loan_prepare_head
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to show
*/
function loan_prepare_head($object)
{
global $langs, $conf;
$tab = 0;
$head = array();
$head[$tab][0] = DOL_URL_ROOT . '/loan/card.php?id=' . $object->id;
$head[$tab][1] = $langs->trans('Card');
$head[$tab][2] = 'card';
$tab++;
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
$nbNote = (empty($object->note_private) ? 0 : 1) + (empty($object->note_public) ? 0 : 1);
$head[$tab][0] = DOL_URL_ROOT . "/loan/note.php?id=" . $object->id;
$head[$tab][1] = $langs->trans("Notes");
if ($nbNote > 0) {
$head[$tab][1] .= ' <span class="badge">' . $nbNote . '</span>';
}
$head[$tab][2] = 'note';
$tab++;
}
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $tab, 'loan');
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$upload_dir = $conf->loan->dir_output . "/" . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
$head[$tab][0] = DOL_URL_ROOT . '/loan/document.php?id=' . $object->id;
$head[$tab][1] = $langs->trans("Documents");
if ($nbFiles > 0) {
$head[$tab][1] .= ' <span class="badge">' . $nbFiles . '</span>';
}
$head[$tab][2] = 'documents';
$tab++;
$head[$tab][0] = DOL_URL_ROOT . '/loan/info.php?id=' . $object->id;
$head[$tab][1] = $langs->trans("Info");
$head[$tab][2] = 'info';
$tab++;
complete_head_from_modules($conf, $langs, $object, $head, $tab, 'loan', 'remove');
return $head;
}
示例10: dol_dir_list
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 ' ';
}
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();
示例11: foreach
foreach ($listmodulepart as $modulepart)
{
$filearray=array();
$upload_dir = isset($conf->$modulepart->dir_output)?$conf->$modulepart->dir_output:'';
if ($modulepart == 'company') $upload_dir = $conf->societe->dir_output; // TODO change for multicompany sharing
if ($modulepart == 'invoice') $upload_dir = $conf->facture->dir_output;
if ($modulepart == 'invoice_supplier') $upload_dir = $conf->fournisseur->facture->dir_output;
if ($modulepart == 'order') $upload_dir = $conf->commande->dir_output;
if ($modulepart == 'order_supplier') $upload_dir = $conf->fournisseur->commande->dir_output;
if ($modulepart == 'contract') $upload_dir = $conf->contrat->dir_output;
if (empty($upload_dir)) continue;
print '<tr><td colspan="2">Clean orphelins files into files '.$upload_dir.'</td></tr>';
$filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','(\.meta|_preview\.png)$','^temp$','^payments$','^CVS$','^thumbs$'),'',SORT_DESC,1);
// To show ref or specific information according to view to show (defined by $module)
if ($modulepart == 'invoice')
{
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$object_instance=new Facture($db);
}
else if ($modulepart == 'invoice_supplier')
{
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$object_instance=new FactureFournisseur($db);
}
else if ($modulepart == 'propal')
{
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
示例12: info
/**
* Return description of a module
*
* @param Translate $langs Lang object to use for output
* @return string Description
*/
function info($langs)
{
global $conf, $langs;
$langs->load("companies");
$langs->load("errors");
$form = new Form($this->db);
$texte = $this->description . ".<br>\n";
$texte .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
$texte .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
$texte .= '<input type="hidden" name="action" value="setModuleOptions">';
$texte .= '<input type="hidden" name="param1" value="SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH">';
if ($conf->global->MAIN_SUPPLIER_PROPOSAL_CHOOSE_ODT_DOCUMENT > 0) {
$texte .= '<input type="hidden" name="param2" value="SUPPLIER_PROPOSAL_ADDON_PDF_ODT_DEFAULT">';
$texte .= '<input type="hidden" name="param3" value="SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL">';
$texte .= '<input type="hidden" name="param4" value="SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED">';
}
$texte .= '<table class="nobordernopadding" width="100%">';
// List of directories area
$texte .= '<tr><td>';
$texttitle = $langs->trans("ListOfDirectories");
$listofdir = explode(',', preg_replace('/[\\r\\n]+/', ',', trim($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH)));
$listoffiles = array();
foreach ($listofdir as $key => $tmpdir) {
$tmpdir = trim($tmpdir);
$tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir);
if (!$tmpdir) {
unset($listofdir[$key]);
continue;
}
if (!is_dir($tmpdir)) {
$texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0);
} else {
$tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\\.(ods|odt)');
if (count($tmpfiles)) {
$listoffiles = array_merge($listoffiles, $tmpfiles);
}
}
}
$texthelp = $langs->trans("ListOfDirectoriesForModelGenODT");
// Add list of substitution keys
$texthelp .= '<br>' . $langs->trans("FollowingSubstitutionKeysCanBeUsed") . '<br>';
$texthelp .= $langs->transnoentitiesnoconv("FullListOnOnlineDocumentation");
// This contains an url, we don't modify it
$texte .= $form->textwithpicto($texttitle, $texthelp, 1, 'help', '', 1);
$texte .= '<div><div style="display: inline-block; min-width: 100px; vertical-align: middle;">';
$texte .= '<textarea class="flat" cols="60" name="value1">';
$texte .= $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH;
$texte .= '</textarea>';
$texte .= '</div><div style="display: inline-block; vertical-align: middle;">';
$texte .= '<input type="submit" class="button" value="' . $langs->trans("Modify") . '" name="Button">';
$texte .= '<br></div></div>';
// Scan directories
if (count($listofdir)) {
$texte .= $langs->trans("NumberOfModelFilesFound") . ': <b>' . count($listoffiles) . '</b>';
if ($conf->global->MAIN_SUPPLIER_PROPOSAL_CHOOSE_ODT_DOCUMENT > 0) {
// Model for creation
$liste = ModelePDFSupplierProposal::liste_modeles($this->db);
$texte .= '<table width="50%;">';
$texte .= '<tr>';
$texte .= '<td width="60%;">' . $langs->trans("DefaultModelSupplierProposalCreate") . '</td>';
$texte .= '<td colspan="">';
$texte .= $form->selectarray('value2', $liste, $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_DEFAULT);
$texte .= "</td></tr>";
$texte .= '<tr>';
$texte .= '<td width="60%;">' . $langs->trans("DefaultModelSupplierProposalToBill") . '</td>';
$texte .= '<td colspan="">';
$texte .= $form->selectarray('value3', $liste, $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL);
$texte .= "</td></tr>";
$texte .= '<tr>';
$texte .= '<td width="60%;">' . $langs->trans("DefaultModelSupplierProposalClosed") . '</td>';
$texte .= '<td colspan="">';
$texte .= $form->selectarray('value4', $liste, $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED);
$texte .= "</td></tr>";
$texte .= '</table>';
}
}
$texte .= '</td>';
$texte .= '<td valign="top" rowspan="2" class="hideonsmartphone">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</td>';
$texte .= '</tr>';
$texte .= '</table>';
$texte .= '</form>';
return $texte;
}
示例13: restrictedArea
$diroutputpdf = $conf->facture->dir_output . '/unpaid/temp';
// Security check
if ($user->societe_id) {
$socid = $user->societe_id;
}
$result = restrictedArea($user, 'facture', $id, '');
/*
* Action
*/
if ($action == "builddoc" && $user->rights->facture->lire) {
if (is_array($_POST['toGenerate'])) {
$arrayofexclusion = array();
foreach ($_POST['toGenerate'] as $tmppdf) {
$arrayofexclusion[] = preg_quote($tmppdf . '.pdf', '/');
}
$factures = dol_dir_list($conf->facture->dir_output, 'all', 1, implode('|', $arrayofexclusion), '\\.meta$|\\.png', 'date', SORT_DESC);
// liste les fichiers
$files = array();
$factures_bak = $factures;
foreach ($_POST['toGenerate'] as $basename) {
foreach ($factures as $facture) {
if (strstr($facture["name"], $basename)) {
$files[] = $conf->facture->dir_output . '/' . $basename . '/' . $facture["name"];
}
}
}
// Define output language (Here it is not used because we do only merging existing PDF)
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) {
$newlang = GETPOST('lang_id');
示例14: actions_prepare_head
/**
* Prepare array with list of tabs
*
* @param object $object Object related to tabs
* @return array Array of tabs to show
*/
function actions_prepare_head($object)
{
global $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT . '/comm/action/card.php?id=' . $object->id;
$head[$h][1] = $langs->trans("CardAction");
$head[$h][2] = 'card';
$h++;
// Attached files
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$upload_dir = $conf->agenda->dir_output . "/" . $object->id;
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
$head[$h][0] = DOL_URL_ROOT . '/comm/action/document.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Documents");
if ($nbFiles > 0) {
$head[$h][1] .= ' <span class="badge">' . $nbFiles . '</span>';
}
$head[$h][2] = 'documents';
$h++;
$head[$h][0] = DOL_URL_ROOT . '/comm/action/info.php?id=' . $object->id;
$head[$h][1] = $langs->trans('Info');
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'action');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'action', 'remove');
return $head;
}
示例15: facture_prepare_head
/**
* Initialize the array of tabs for customer invoice
*
* @param Facture $object Invoice object
* @return array Array of head tabs
*/
function facture_prepare_head($object)
{
global $langs, $conf;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT . '/compta/facture.php?facid=' . $object->id;
$head[$h][1] = $langs->trans('CardBill');
$head[$h][2] = 'compta';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
$head[$h][0] = DOL_URL_ROOT . '/compta/facture/contact.php?facid=' . $object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
$head[$h][2] = 'contact';
$h++;
}
if (!empty($conf->global->MAIN_USE_PREVIEW_TABS)) {
$head[$h][0] = DOL_URL_ROOT . '/compta/facture/apercu.php?facid=' . $object->id;
$head[$h][1] = $langs->trans('Preview');
$head[$h][2] = 'preview';
$h++;
}
//if ($fac->mode_reglement_code == 'PRE')
if (!empty($conf->prelevement->enabled)) {
$head[$h][0] = DOL_URL_ROOT . '/compta/facture/prelevement.php?facid=' . $object->id;
$head[$h][1] = $langs->trans('StandingOrders');
$head[$h][2] = 'standingorders';
$h++;
}
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice');
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
$nbNote = 0;
if (!empty($object->note_private)) {
$nbNote++;
}
if (!empty($object->note_public)) {
$nbNote++;
}
$head[$h][0] = DOL_URL_ROOT . '/compta/facture/note.php?facid=' . $object->id;
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) {
$head[$h][1] .= ' <span class="badge">' . $nbNote . '</span>';
}
$head[$h][2] = 'note';
$h++;
}
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
$head[$h][0] = DOL_URL_ROOT . '/compta/facture/document.php?facid=' . $object->id;
$head[$h][1] = $langs->trans('Documents');
if ($nbFiles > 0) {
$head[$h][1] .= ' <span class="badge">' . $nbFiles . '</span>';
}
$head[$h][2] = 'documents';
$h++;
$head[$h][0] = DOL_URL_ROOT . '/compta/facture/info.php?facid=' . $object->id;
$head[$h][1] = $langs->trans('Info');
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice', 'remove');
return $head;
}