Ejemplo n.º 1
0
/**
*    Show header of a VAT report
*    @param      nom             Name of report
*    @param      variante        Link for alternate report
*    @param      period          Period of report
*    @param      periodlink      Link to switch period
*    @param      description     Description
*    @param      builddate       Date generation
*    @param      exportlink      Link for export or ''
*/
function report_header($nom,$variante='',$period,$periodlink,$description,$builddate,$exportlink='')
{
	global $langs;

	print "\n\n<!-- debut cartouche rapport -->\n";

	$h=0;
	$head[$h][0] = $_SERVER["PHP_SELF"];
	$head[$h][1] = $langs->trans("Report");
	dol_fiche_head($head, $hselected, $societe->nom);

	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
	print '<table width="100%" class="border">';

	// Ligne de titre
	print '<tr>';
	print '<td valign="top" width="110">'.$langs->trans("ReportName").'</td>';
	if (! $variante) print '<td colspan="3">';
	else print '<td>';
	print $nom;
	if ($variante) print '</td><td colspan="2">'.$variante;
	print '</td>';
	print '</tr>';

	// Ligne de la periode d'analyse du rapport
	print '<tr>';
	print '<td>'.$langs->trans("ReportPeriod").'</td>';
	if (! $periodlink) print '<td colspan="3">';
	else print '<td>';
	if ($period) print $period;
	if ($periodlink) print '</td><td colspan="2">'.$periodlink;
	print '</td>';
	print '</tr>';

	// Ligne de description
	print '<tr>';
	print '<td valign="top">'.$langs->trans("ReportDescription").'</td>';
	print '<td colspan="3">'.$description.'</td>';
	print '</tr>';

	// Ligne d'export
	print '<tr>';
	print '<td>'.$langs->trans("GeneratedOn").'</td>';
	if (! $exportlink) print '<td colspan="3">';
	else print '<td>';
	print dol_print_date($builddate);
	if ($exportlink) print '</td><td>'.$langs->trans("Export").'</td><td>'.$exportlink;
	print '</td></tr>';

	print '<tr>';
	print '<td colspan="4" align="center"><input type="submit" class="button" name="submit" value="'.$langs->trans("Refresh").'"></td>';
	print '</tr>';

	print '</table>';

	print '</form>';

	print '</div>';
	print "\n<!-- fin cartouche rapport -->\n\n";
}
Ejemplo n.º 2
0
function _list(&$PDOdb)
{
    global $langs, $conf, $user, $db;
    llxHeader();
    dol_fiche_head(array(), 'menu', 'Menu');
    $l = new TListviewTBS('lMenu');
    $sql = "SELECT rowid,title, type_menu, tab_object, mainmenu,leftmenu,date_cre \n\tFROM " . MAIN_DB_PREFIX . "query_menu \n\tWHERE entity IN (0," . $conf->entity . ")";
    $menu_static = new TQueryMenu();
    echo $l->render($PDOdb, $sql, array('title' => array('title' => $langs->trans('Title'), 'leftmenu' => $langs->trans('LeftMenu'), 'mainmenu' => $langs->trans('MainMenu'), 'date_cre' => $langs->trans('Date'), 'tab_object' => $langs->trans('TabsObject'), 'type_menu' => $langs->trans('TypeMenu')), 'translate' => array('tab_object' => $menu_static->TTabObject, 'type_menu' => $menu_static->TTypeMenu), 'link' => array('title' => '<a href="?id=@rowid@&action=edit">@val@</a>'), 'hide' => array('rowid'), 'type' => array('date_cre' => 'date')));
    /*$kiwi = new TKiwi;
    	$kiwi->fk_soc = $object->id;
    	$kiwi->fk_product = 1;
    	$kiwi->save($PDOdb);
    	*/
    // pied de page
    dol_fiche_end();
    llxFooter();
}
Ejemplo n.º 3
0
function _list(&$PDOdb)
{
    global $langs, $conf, $user, $db;
    llxHeader();
    $url = 'lib/adminer/?';
    //TODO genrate read profile
    /*
    $url.='&server='.$dolibarr_main_db_host;
    $url.='&db='.$dolibarr_main_db_name;
    $url.='&username='******'&password='******'&driver='.$dolibarr_main_db_type;
    */
    ?>
	
	<a href="<?php 
    echo $url;
    ?>
" class="butAction" target="_blank">Accès à la base de données</a>
	
<?php 
    if (!empty($user->rights->query->bdd->use_other_db)) {
        dol_fiche_head(array(), 'bdd', 'BDD');
        $l = new TListviewTBS('lMenu');
        $sql = "SELECT rowid, host, db_name,login,port,charset, '' as 'alive'\n\tFROM " . MAIN_DB_PREFIX . "query_bdd_connector \n\tWHERE entity IN (0," . $conf->entity . ")";
        echo $l->render($PDOdb, $sql, array('title' => array('host' => $langs->trans('Host'), 'db_name' => $langs->trans('DBName'), 'port' => $langs->trans('Port'), 'charset' => $langs->trans('Charset'), 'login' => $langs->trans('Login'), 'alive' => $langs->trans('Alive')), 'link' => array('host' => '<a href="?id=@rowid@&action=edit">@val@</a>'), 'hide' => array('rowid'), 'type' => array('date_cre' => 'date'), 'eval' => array('alive' => '_test_alive(@rowid@)')));
        /*$kiwi = new TKiwi;
        	$kiwi->fk_soc = $object->id;
        	$kiwi->fk_product = 1;
        	$kiwi->save($PDOdb);
        	*/
        // pied de page
        dol_fiche_end();
    }
    llxFooter();
}
Ejemplo n.º 4
0
/*
 *  Actions
 */
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php';
// Must be include, not include_once
/*
 *  View
 */
$form = new Form($db);
llxHeader('', $langs->trans("LoanArea") . ' - ' . $langs->trans("Notes"), '');
if ($id > 0) {
    /*
     * Affichage onglets
     */
    $head = loan_prepare_head($object);
    dol_fiche_head($head, 'note', $langs->trans("Loan"), 0, 'loan');
    print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
    print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
    print '<table class="border" width="100%">';
    // Ref
    print '<tr><td width="25%">' . $langs->trans('Ref') . '</td>';
    print '<td colspan="3">';
    print $form->showrefnav($object, 'id', '', '', 'rowid', 'ref');
    print '</td></tr>';
    // Name
    print '<tr><td width="20%">' . $langs->trans("Name") . '</td>';
    print '<td colspan="3">' . $object->label . '</td></tr>';
    print "</table>";
    print '<br>';
    $colwidth = '25';
    $permission = $user->rights->loan->write;
Ejemplo n.º 5
0
		$expedition=new Expedition($db);
		$result = $expedition->fetch($delivery->origin_id);
		$typeobject = $expedition->origin;

		if ($delivery->origin_id)
		{
			$delivery->fetch_origin();
		}

		if ( $delivery->id > 0)
		{
			$soc = new Societe($db);
			$soc->fetch($delivery->socid);

			$head=delivery_prepare_head($delivery);
			dol_fiche_head($head, 'delivery', $langs->trans("Sending"), 0, 'sending');

			/*
			 * Confirmation de la suppression
			 *
			 */
			if ($_GET["action"] == 'delete')
			{
				$expedition_id = $_GET["expid"];
				$ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$delivery->id.'&amp;expid='.$expedition_id,$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm",$delivery->ref),'confirm_delete','','',1);
				if ($ret == 'html') print '<br>';
			}

			/*
			 * Confirmation de la validation
			 *
Ejemplo n.º 6
0
// Must be include, not includ_once
/*
 *	View
 */
$form = new Form($db);
$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('', $langs->trans("ThirdParty") . ' - ' . $langs->trans("Notes"), $help_url);
if ($id > 0) {
    /*
     * Affichage onglets
     */
    if (!empty($conf->notification->enabled)) {
        $langs->load("mails");
    }
    $head = societe_prepare_head($object);
    dol_fiche_head($head, 'note', $langs->trans("ThirdParty"), 0, 'company');
    print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
    print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
    print '<table class="border" width="100%">';
    print '<tr><td width="25%">' . $langs->trans('ThirdPartyName') . '</td>';
    print '<td colspan="3">';
    print $form->showrefnav($object, 'socid', '', $user->societe_id ? 0 : 1, 'rowid', 'nom');
    print '</td></tr>';
    // Alias names (commercial, trademark or alias names)
    print '<tr><td>' . $langs->trans('AliasNames') . '</td><td colspan="3">';
    print $object->name_alias;
    print "</td></tr>";
    if (!empty($conf->global->SOCIETE_USEPREFIX)) {
        print '<tr><td>' . $langs->trans('Prefix') . '</td><td colspan="3">' . $object->prefix_comm . '</td></tr>';
    }
    if ($object->client) {
         dol_print_error($db);
     }
 }
 $i = 0;
 $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks';
 $texte = $langs->trans("ListOfStockMovements");
 if ($id) {
     $texte .= ' (' . $langs->trans("ForThisWarehouse") . ')';
 }
 llxHeader("", $texte, $help_url);
 /*
  * Show tab only if we ask a particular warehouse
  */
 if ($id) {
     $head = stock_prepare_head($entrepot);
     dol_fiche_head($head, 'movements', $langs->trans("Warehouse"), 0, 'stock');
     print '<table class="border" width="100%">';
     $linkback = '<a href="' . DOL_URL_ROOT . '/adherents/liste.php">' . $langs->trans("BackToList") . '</a>';
     // Ref
     print '<tr><td width="25%">' . $langs->trans("Ref") . '</td><td colspan="3">';
     print $form->showrefnav($entrepot, 'id', $linkback, 1, 'rowid', 'libelle');
     print '</td>';
     print '<tr><td>' . $langs->trans("LocationSummary") . '</td><td colspan="3">' . $entrepot->lieu . '</td></tr>';
     // Description
     print '<tr><td valign="top">' . $langs->trans("Description") . '</td><td colspan="3">' . dol_htmlentitiesbr($entrepot->description) . '</td></tr>';
     // Address
     print '<tr><td>' . $langs->trans('Address') . '</td><td colspan="3">';
     print $entrepot->address;
     print '</td></tr>';
     // Town
     print '<tr><td width="25%">' . $langs->trans('Zip') . '</td><td width="25%">' . $entrepot->zip . '</td>';
Ejemplo n.º 8
0
if ($action == 'addthumb' && $_GET["file"]) {
    $object->add_thumb($dir . "/" . $_GET["file"]);
}
/*
 *	View
 */
$form = new Form($db);
if ($object->id) {
    llxHeader("", "", $langs->trans("CardProduct" . $object->type));
    /*
     *  En mode visu
     */
    $head = product_prepare_head($object, $user);
    $titre = $langs->trans("CardProduct" . $object->type);
    $picto = $object->type == 1 ? 'service' : 'product';
    dol_fiche_head($head, 'photos', $titre, 0, $picto);
    /*
     * Confirmation de la suppression de photo
     */
    if ($action == 'delete') {
        print $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&file=' . $_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1);
    }
    print $mesg;
    print '<table class="border" width="100%">';
    // Reference
    print '<tr>';
    print '<td width="15%">' . $langs->trans("Ref") . '</td><td colspan="2">';
    print $form->showrefnav($object, 'ref', '', 1, 'ref');
    print '</td>';
    print '</tr>';
    // Libelle
Ejemplo n.º 9
0
print $langs->trans("ECMAreaDesc2")."<br>";
print "<br>\n";
print '</div>';
*/
// Confirm remove file (for non javascript users)
if ($action == 'delete' && empty($conf->use_javascript_ajax)) {
    print $form->formconfirm($_SERVER["PHP_SELF"] . '?section=' . $section . '&urlfile=' . urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 1);
}
if (!empty($conf->use_javascript_ajax)) {
    $classviewhide = 'hidden';
} else {
    $classviewhide = 'visible';
}
if (empty($conf->dol_use_jmobile)) {
    $head = ecm_prepare_dasboard_head('');
    dol_fiche_head($head, 'index_auto', '', 1, '');
}
// Start container of all panels
?>
<div id="containerlayout"> <!-- begin div id="containerlayout" -->
<div id="ecm-layout-north" class="toolbar largebutton">
<?php 
// Start top panel, toolbar
print '<div class="toolbarbutton">';
// Toolbar
$url = !empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS) ? '#' : $_SERVER["PHP_SELF"] . '?action=refreshmanual' . ($module ? '&amp;module=' . $module : '') . ($section ? '&amp;section=' . $section : '');
print '<a href="' . $url . '" class="toolbarbutton" title="' . dol_escape_htmltag($langs->trans('Refresh')) . '">';
print '<img id="refreshbutton" class="toolbarbutton" border="0" src="' . DOL_URL_ROOT . '/theme/common/view-refresh.png">';
print '</a>';
print '</div>';
// End top panel, toolbar
Ejemplo n.º 10
0
     $parameters = array('colspan' => ' colspan="3"', 'colspanvalue' => '3', 'id' => $object->id);
     $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
     // Note that $action and $object may have been modified by hook
     if (empty($reshook) && !empty($extrafields->attribute_label)) {
         print $object->showOptionals($extrafields, 'edit');
     }
     print '</table>';
     dol_fiche_end();
     print '<div class="center">';
     print '<input type="submit" class="button" name="edit" value="' . $langs->trans("Save") . '">';
     print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
     print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">';
     print '</div>';
     print '</form>';
 } else {
     dol_fiche_head($head, 'card', $langs->trans("Action"), 0, 'action');
     // Clone event
     if ($action == 'clone') {
         $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . GETPOST('id'), $langs->trans('CloneAction'), $langs->trans('ConfirmCloneAction', $object->label), 'confirm_clone', $formquestion, 'yes', 1);
         print $formconfirm;
     }
     // Affichage fiche action en mode visu
     print '<table class="border" width="100%">';
     $linkback = '<a href="' . DOL_URL_ROOT . '/comm/action/listactions.php">' . $langs->trans("BackToList") . '</a>';
     // Ref
     print '<tr><td width="30%">' . $langs->trans("Ref") . '</td><td colspan="3">';
     print $form->showrefnav($object, 'id', $linkback, $user->societe_id ? 0 : 1, 'id', 'ref', '');
     print '</td></tr>';
     // Type
     if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
         print '<tr><td>' . $langs->trans("Type") . '</td><td colspan="3">' . $object->type . '</td></tr>';
    accessforbidden();
}
/*
* Actions
*/
require DOL_DOCUMENT_ROOT . '/core/actions_extrafields.inc.php';
/*
* View
*/
$textobject = strtolower($langs->transnoentitiesnoconv("BillsCustomers"));
llxHeader('', $langs->trans("BillsSetup"));
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print_fiche_titre($langs->trans("BillsSetup"), $linkback, 'setup');
print '<br>';
$head = invoice_admin_prepare_head(null);
dol_fiche_head($head, 'attributeslines', $langs->trans("Invoices"), 0, 'invoice');
print $langs->trans("DefineHereComplementaryAttributes", $textobject) . '<br><br>' . "\n";
// Load attribute_label
$extrafields->fetch_name_optionals_label($elementtype);
print "<table summary=\"listofattributes\" class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">';
print '<td align="center">' . $langs->trans("Position") . '</td>';
print '<td>' . $langs->trans("Label") . '</td>';
print '<td>' . $langs->trans("AttributeCode") . '</td>';
print '<td>' . $langs->trans("Type") . '</td>';
print '<td align="right">' . $langs->trans("Size") . '</td>';
print '<td align="center">' . $langs->trans("Unique") . '</td>';
print '<td align="center">' . $langs->trans("Required") . '</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
$var = True;
Ejemplo n.º 12
0
    print "</form>\n";
    print "</div>\n";
}
/* ************************************************************ */
/*                                                              */
/* Fiche don en mode visu                                       */
/*                                                              */
/* ************************************************************ */
if (!empty($id) && $action != 'edit') {
    $result = $don->fetch($id);
    $h = 0;
    $head[$h][0] = $_SERVER['PHP_SELF'] . "?id=" . $don->id;
    $head[$h][1] = $langs->trans("Card");
    $hselected = $h;
    $h++;
    dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic');
    print "<form action=\"fiche.php\" method=\"post\">";
    print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
    print '<table class="border" width="100%">';
    $linkback = '<a href="' . DOL_URL_ROOT . '/compta/dons/liste.php' . (!empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
    $nbrows = 12;
    if (!empty($conf->projet->enabled)) {
        $nbrows++;
    }
    // Ref
    print "<tr>" . '<td>' . $langs->trans("Ref") . '</td><td colspan="2">';
    print $form->showrefnav($don, 'rowid', $linkback, 1, 'rowid', 'ref', '');
    print '</td>';
    print '</tr>';
    // Date
    print '<tr><td width="25%">' . $langs->trans("Date") . '</td><td>';
Ejemplo n.º 13
0
    $parameters = array('colspan' => ' colspan="2"');
    $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
    // Note that $action and $object may have been modified by hook
    print '</table>';
    print '<br><div class="center">';
    print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">';
    print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
    print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
    print '</div>';
    print '</form>';
} else {
    if ($id) {
        $result = $object->fetch($id);
        if ($result > 0) {
            $head = trip_prepare_head($object);
            dol_fiche_head($head, 'card', $langs->trans("TripCard"), 0, 'trip');
            if ($action == 'edit' && $user->rights->deplacement->creer) {
                //WYSIWYG Editor
                require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
                $soc = new Societe($db);
                if ($object->socid) {
                    $soc->fetch($object->socid);
                }
                print '<form name="update" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
                print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
                print '<input type="hidden" name="action" value="update">';
                print '<input type="hidden" name="id" value="' . $id . '">';
                print '<table class="border" width="100%">';
                // Ref
                print "<tr>";
                print '<td width="20%">' . $langs->trans("Ref") . '</td><td>';
Ejemplo n.º 14
0
$data = $stats->getAllByYear();
$arrayyears = array();
foreach ($data as $val) {
    $arrayyears[$val['year']] = $val['year'];
}
if (!count($arrayyears)) {
    $arrayyears[$nowyear] = $nowyear;
}
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT . '/compta/expensereport/stats/index.php';
$head[$h][1] = $langs->trans("ByMonthYear");
$head[$h][2] = 'byyear';
$h++;
complete_head_from_modules($conf, $langs, null, $head, $h, 'trip_stats');
dol_fiche_head($head, 'byyear', $langs->trans("Statistics"));
print '<div class="fichecenter"><div class="fichethirdleft">';
// Show filter box
print '<form name="stats" method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
print '<input type="hidden" name="mode" value="' . $mode . '">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">' . $langs->trans("Filter") . '</td></tr>';
// Company
/*
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
$filter='';
print $form->select_company($socid,'socid',$filter,1,1);
print '</td></tr>';
*/
// User
print '<tr><td>' . $langs->trans("User") . '</td><td>';
Ejemplo n.º 15
0
            if ($printer->listAvailablePrinters() == 0) {
                print $printer->resprint;
            } else {
                setEventMessages($printer->error, $printer->errors, 'errors');
            }
        } else {
            print $langs->trans('PleaseConfigureDriverfromList');
        }
    } else {
        print $langs->trans('PleaseSelectaDriverfromList');
    }
    print '</table>';
    dol_fiche_end();
}
if ($mode == 'userconf' && $user->admin) {
    dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), 0, 'technic');
    print $langs->trans('PrintUserConfDesc' . $driver) . "<br><br>\n";
    print '<table class="noborder" width="100%">';
    $var = true;
    print '<tr class="liste_titre">';
    print '<th>' . $langs->trans("User") . '</th>';
    print '<th>' . $langs->trans("PrintModule") . '</th>';
    print '<th>' . $langs->trans("PrintDriver") . '</th>';
    print '<th>' . $langs->trans("Printer") . '</th>';
    print '<th>' . $langs->trans("PrinterLocation") . '</th>';
    print '<th>' . $langs->trans("PrinterId") . '</th>';
    print '<th>' . $langs->trans("NumberOfCopy") . '</th>';
    print '<th class="center">' . $langs->trans("Delete") . '</th>';
    print "</tr>\n";
    $sql = 'SELECT p.rowid, p.printer_name, p.printer_location, p.printer_id, p.copy, p.module, p.driver, p.userid, u.login FROM ' . MAIN_DB_PREFIX . 'printing as p, ' . MAIN_DB_PREFIX . 'user as u WHERE p.userid=u.rowid';
    $resql = $db->query($sql);
    // From "custom" directory
}
// Libraries
require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php";
require_once '../lib/lcr.lib.php';
// Translations
$langs->load("lcr@lcr");
// Access control
if (!$user->admin) {
    accessforbidden();
}
/*
 * View
 */
$page_name = "lcrAbout";
llxHeader('', $langs->trans($page_name));
// Subheader
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print_fiche_titre($langs->trans($page_name), $linkback);
// Configuration header
$head = lcrAdminPrepareHead();
dol_fiche_head($head, 'about', $langs->trans("Module104940Name"), 0, 'lcr@lcr');
// About page goes here
print '<div style="float: left;"><img src="../img/Dolibarr_Preferred_Partner_logo.png" /></div>';
print '<div>' . $langs->trans('ATMAbout') . '</div>';
dol_fiche_end();
print '<br><center>';
print '<a href="http://www.atm-consulting.fr" target="_blank"><img src="../img/ATM_logo.jpg" /></a>';
print '</center>';
llxFooter();
$db->close();
Ejemplo n.º 17
0
}
/**
 * View
 */
$form = new Form($db);
llxHeader('', $langs->trans("Permissions"));
if ($id) {
    $fgroup = new Usergroup($db);
    $fgroup->fetch($id);
    $fgroup->getrights();
    /*
     * Affichage onglets
     */
    $head = group_prepare_head($fgroup);
    $title = $langs->trans("Group");
    dol_fiche_head($head, 'rights', $title, 0, 'group');
    // Charge les modules soumis a permissions
    $modules = array();
    $modulesdir = dolGetModulesDirs();
    $db->begin();
    foreach ($modulesdir as $dir) {
        // Load modules attributes in arrays (name, numero, orders) from dir directory
        //print $dir."\n<br>";
        $handle = @opendir(dol_osencode($dir));
        if (is_resource($handle)) {
            while (($file = readdir($handle)) !== false) {
                if (is_readable($dir . $file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') {
                    $modName = substr($file, 0, dol_strlen($file) - 10);
                    if ($modName) {
                        include_once $dir . "/" . $file;
                        $objMod = new $modName($db);
Ejemplo n.º 18
0
 }
 // Build document if it not exists
 if (!$file || !is_readable($file)) {
     $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
     if ($result <= 0) {
         dol_print_error($db, $object->error, $object->errors);
         exit;
     }
     $fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref, '/') . '[^\\-]+');
     $file = $fileparams['fullname'];
 }
 print '<div class="clearboth"></div>';
 print '<br>';
 print load_fiche_titre($langs->trans($titreform));
 // Cree l'objet formulaire mail
 dol_fiche_head();
 include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
 $formmail = new FormMail($db);
 $formmail->param['langsmodels'] = empty($newlang) ? $langs->defaultlang : $newlang;
 $formmail->fromtype = 'user';
 $formmail->fromid = $user->id;
 $formmail->fromname = $user->getFullName($langs);
 $formmail->frommail = $user->email;
 if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && $conf->global->MAIN_EMAIL_ADD_TRACK_ID & 1) {
     $formmail->trackid = 'inv' . $object->id;
 }
 if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && $conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2) {
     include DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
     $formmail->frommail = dolAddEmailTrackId($formmail->frommail, 'inv' . $object->id);
 }
 $formmail->withfrom = 1;
Ejemplo n.º 19
0
// Security check
$id = GETPOST('id', 'int');
if ($user->societe_id) {
    $socid = $user->societe_id;
}
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
/*
 *	View
 */
$title = !empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses");
llxHeader('', $title, 'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas');
$form = new Form($db);
$contact = new Contact($db);
$contact->fetch($id, $user);
$head = contact_prepare_head($contact);
dol_fiche_head($head, 'exportimport', $title, 0, 'contact');
/*
 * Fiche en mode visu
 */
print '<table class="border" width="100%">';
$linkback = '<a href="' . DOL_URL_ROOT . '/contact/list.php">' . $langs->trans("BackToList") . '</a>';
// Ref
print '<tr><td>' . $langs->trans("Ref") . '</td><td colspan="3">';
print $form->showrefnav($contact, 'id', $linkback);
print '</td></tr>';
// Name
print '<tr><td width="20%">' . $langs->trans("Lastname") . ' / ' . $langs->trans("Label") . '</td><td>' . $contact->lastname . '</td>';
print '<td width="20%">' . $langs->trans("Firstname") . '</td><td width="25%">' . $contact->firstname . '</td></tr>';
// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) {
    if ($contact->socid > 0) {
Ejemplo n.º 20
0
// Must be include, not includ_once
/******************************************************************************/
/* Affichage fiche                                                            */
/******************************************************************************/
llxHeader('', $langs->trans('CommRequest'), 'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur');
$form = new Form($db);
if ($id > 0 || !empty($ref)) {
    if ($mesg) {
        print $mesg;
    }
    $now = dol_now();
    if ($object->fetch($id, $ref)) {
        $societe = new Societe($db);
        if ($societe->fetch($object->socid)) {
            $head = supplier_proposal_prepare_head($object);
            dol_fiche_head($head, 'note', $langs->trans('CommRequest'), 0, 'supplier_proposal');
            print '<table class="border" width="100%">';
            $linkback = '<a href="' . DOL_URL_ROOT . '/supplier_proposal/list.php' . (!empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans('BackToList') . '</a>';
            // Ref
            print '<tr><td width="25%">' . $langs->trans('Ref') . '</td><td colspan="3">';
            print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
            print '</td></tr>';
            // Customer
            if (is_null($object->client)) {
                $object->fetch_thirdparty();
            }
            print "<tr><td>" . $langs->trans("Supplier") . "</td>";
            print '<td colspan="3">' . $object->client->getNomUrl(1) . '</td></tr>';
            print '<tr><td>' . $langs->trans('SupplierProposalDate') . '</td><td colspan="3">';
            print dol_print_date($object->date_livraison, 'daytext');
            print '</td>';
    accessforbidden();
}
/*
 * Actions
 */
require DOL_DOCUMENT_ROOT . '/core/actions_extrafields.inc.php';
/*
 * View
 */
$textobject = $langs->transnoentitiesnoconv("Categories");
$help_url = 'EN:Module Categories|FR:Module Catégories|ES:Módulo Categorías';
llxHeader('', $langs->trans("Categories"), $help_url);
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print_fiche_titre($langs->trans("CategoriesSetup"), $linkback, 'title_setup');
$head = categoriesadmin_prepare_head();
dol_fiche_head($head, 'attributes_categories', $langs->trans("Categories"), 0, 'category');
require DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
    print '<div class="tabsAction">';
    print "<a class=\"butAction\" href=\"" . $_SERVER["PHP_SELF"] . "?action=create\">" . $langs->trans("NewAttribute") . "</a>";
    print "</div>";
}
/* ************************************************************************** */
/*                                                                            */
/* Creation d'un champ optionnel
 /*                                                                            */
/* ************************************************************************** */
if ($action == 'create') {
    print "<br>";
Ejemplo n.º 22
0
 } else {
     if ($page > 0) {
         $limitsql = ($totalPages - $page) * $viewline;
         if ($limitsql < $viewline) {
             $limitsql = $viewline;
         }
         $nbline = $limitsql;
     } else {
         $page = 0;
         $limitsql = $nbline;
     }
 }
 //print $limitsql.'-'.$page.'-'.$viewline;
 // Onglets
 $head = bank_prepare_head($object);
 dol_fiche_head($head, 'journal', $langs->trans("FinancialAccount"), 0, 'account');
 print '<table class="border" width="100%">';
 $linkback = '<a href="' . DOL_URL_ROOT . '/compta/bank/index.php">' . $langs->trans("BackToList") . '</a>';
 // Ref
 print '<tr><td width="25%">' . $langs->trans("Ref") . '</td>';
 print '<td colspan="3">';
 print $form->showrefnav($object, 'ref', $linkback, 1, 'ref');
 print '</td></tr>';
 // Label
 print '<tr><td>' . $langs->trans("Label") . '</td>';
 print '<td colspan="3">' . $object->label . '</td></tr>';
 print '</table>';
 dol_fiche_end();
 /*
  * Buttons actions
  */
Ejemplo n.º 23
0
                }
            }
        }
    }
}
/*
 * View
 */
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
llxHeader("", $langs->trans("OrdersSetup"));
$form = new Form($db);
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print_fiche_titre($langs->trans("OrdersSetup"), $linkback, 'setup');
print '<br>';
$head = order_admin_prepare_head(null);
dol_fiche_head($head, 'general', $langs->trans("Orders"), 0, 'order');
/*
 * Orders Numbering model
 */
print_titre($langs->trans("OrdersNumberingModules"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("Name") . '</td>';
print '<td>' . $langs->trans("Description") . '</td>';
print '<td class="nowrap">' . $langs->trans("Example") . '</td>';
print '<td align="center" width="60">' . $langs->trans("Status") . '</td>';
print '<td align="center" width="16">' . $langs->trans("ShortInfo") . '</td>';
print '</tr>' . "\n";
clearstatcache();
foreach ($dirmodels as $reldir) {
    $dir = dol_buildpath($reldir . "core/modules/commande/");
Ejemplo n.º 24
0

/******************************************************************************/
/* Affichage fiche                                                            */
/******************************************************************************/

llxHeader();

$html = new Form($db);

if ($id)
{
	$head = user_prepare_head($fuser);

	$title = $langs->trans("User");
	dol_fiche_head($head, 'note', $title, 0, 'user');

	if ($msg) print '<div class="error">'.$msg.'</div>';

	print "<form method=\"post\" action=\"note.php\">";
	print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';

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

    // Reference
	print '<tr><td width="20%">'.$langs->trans('Ref').'</td>';
	print '<td colspan="3">';
	print $html->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin);
	print '</td>';
	print '</tr>';
Ejemplo n.º 25
0
 * 	\ingroup    donations
 * 	\brief      Page to show a donation information
 */
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/donation.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT . '/don/class/don.class.php';
$langs->load("donations");
// Security check
$id = GETPOST('id', 'int');
if ($user->societe_id) {
    $socid = $user->societe_id;
}
$result = restrictedArea($user, 'don', $id, '');
/*
 * View
 */
llxHeader();
if ($id) {
    $object = new Don($db);
    $object->fetch($id);
    $object->info($id);
    $head = donation_prepare_head($object);
    dol_fiche_head($head, 'info', $langs->trans("Donation"), 0, 'generic');
    print '<table width="100%"><tr><td>';
    dol_print_object_info($object);
    print '</td></tr></table>';
    print '</div>';
}
$db->close();
llxFooter();
Ejemplo n.º 26
0
llxHeader("", "", $langs->trans("Categories"));
if ($type == Categorie::TYPE_PRODUCT) {
    $title = $langs->trans("ProductsCategoryShort");
} elseif ($type == Categorie::TYPE_SUPPLIER) {
    $title = $langs->trans("SuppliersCategoryShort");
} elseif ($type == Categorie::TYPE_CUSTOMER) {
    $title = $langs->trans("CustomersCategoryShort");
} elseif ($type == Categorie::TYPE_MEMBER) {
    $title = $langs->trans("MembersCategoryShort");
} elseif ($type == Categorie::TYPE_CONTACT) {
    $title = $langs->trans("ContactCategoriesShort");
} else {
    $title = $langs->trans("Category");
}
$head = categories_prepare_head($object, $type);
dol_fiche_head($head, 'card', $title, 0, 'category');
/*
 * Confirmation suppression
 */
if ($action == 'delete') {
    print $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;type=' . $type, $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete');
}
print '<table border="0" width="100%" class="border">';
// Path of category
print '<tr><td width="20%" class="notopnoleft">';
$ways = $object->print_all_ways();
print $langs->trans("Ref") . '</td><td>';
print '<a href="' . DOL_URL_ROOT . '/categories/index.php?leftmenu=cat&type=' . $type . '">' . $langs->trans("Root") . '</a> >> ';
foreach ($ways as $way) {
    print $way . "<br>\n";
}
Ejemplo n.º 27
0
    print '</form>';
} else {
    $id = GETPOST("id", 'int');
    if ($id) {
        dol_htmloutput_mesg($mesg);
        $object = new Entrepot($db);
        $result = $object->fetch($id);
        if ($result < 0) {
            dol_print_error($db);
        }
        /*
         * Affichage fiche
         */
        if ($action != 'edit' && $action != 're-edit') {
            $head = stock_prepare_head($object);
            dol_fiche_head($head, 'card', $langs->trans("Warehouse"), 0, 'stock');
            // Confirm delete third party
            if ($action == 'delete') {
                print $form->formconfirm($_SERVER["PHP_SELF"] . "?id=" . $object->id, $langs->trans("DeleteAWarehouse"), $langs->trans("ConfirmDeleteWarehouse", $object->libelle), "confirm_delete", '', 0, 2);
            }
            print '<table class="border" width="100%">';
            $linkback = '<a href="' . DOL_URL_ROOT . '/product/stock/liste.php">' . $langs->trans("BackToList") . '</a>';
            // Ref
            print '<tr><td width="25%">' . $langs->trans("Ref") . '</td><td colspan="3">';
            print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'libelle');
            print '</td>';
            print '<tr><td>' . $langs->trans("LocationSummary") . '</td><td colspan="3">' . $object->lieu . '</td></tr>';
            // Description
            print '<tr><td valign="top">' . $langs->trans("Description") . '</td><td colspan="3">' . nl2br($object->description) . '</td></tr>';
            // Address
            print '<tr><td>' . $langs->trans('Address') . '</td><td colspan="3">';
Ejemplo n.º 28
0
/*********************************************************************************
 *
 * Mode fiche
 *
 *********************************************************************************/
if ($socid > 0) {
    // On recupere les donnees societes par l'objet
    $objsoc = new Societe($db);
    $objsoc->id = $socid;
    $objsoc->fetch($socid);
    $head = societe_prepare_head($objsoc);
    print '<form method="POST" action="remise.php?id=' . $objsoc->id . '">';
    print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
    print '<input type="hidden" name="action" value="setremise">';
    print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
    dol_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"), 0, 'company');
    print '<table class="border" width="100%">';
    // Name
    print '<tr><td colspan="2" width="25%">' . $langs->trans('Name') . '</td>';
    print '<td colspan="2">';
    print $form->showrefnav($objsoc, 'id', '', 1, 'rowid', 'nom');
    print '</td></tr>';
    // Remise
    print '<tr><td colspan="2" width="25%">';
    print $langs->trans("CustomerRelativeDiscount") . '</td><td colspan="2">' . price2num($objsoc->remise_percent) . "%</td></tr>";
    print '</table>';
    print '<br>';
    print_fiche_titre($langs->trans("NewRelativeDiscount"), '', '');
    print '<table class="border" width="100%">';
    // Nouvelle valeur
    print '<tr><td colspan="2">';
Ejemplo n.º 29
0
            Header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
            exit;
        }
    }
}
/*
 * View
 */
llxHeader();
$form = new Form($db);
if ($id > 0 || !empty($ref)) {
    if ($object->fetch($id, $ref)) {
        $upload_dir = $conf->bank->dir_output . '/' . $object->ref;
        // Onglets
        $head = bank_prepare_head($object);
        dol_fiche_head($head, 'document', $langs->trans("FinancialAccount"), 0, 'account');
        // 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%">';
        // Ref
        // Ref
        print '<tr><td valign="top" width="25%">' . $langs->trans("Ref") . '</td>';
        print '<td colspan="3">';
        print $form->showrefnav($object, 'ref', '', 1, 'ref');
        print '</td></tr>';
        // Label
        print '<tr><td valign="top">' . $langs->trans("Label") . '</td>';
Ejemplo n.º 30
0
if ($action == 'unset') {
    $result = dolibarr_del_const($db, GETPOST('name', 'alpha'), $conf->entity);
    if ($result < 0) {
        print $db->error();
    }
}
/*
 * View
 */
$form = new Form($db);
$help_url = 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros';
llxHeader('', $langs->trans("MembersSetup"), $help_url);
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup');
$head = member_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("Members"), 0, 'user');
print load_fiche_titre($langs->trans("MemberMainOptions"), '', '');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("Description") . '</td>';
print '<td>' . $langs->trans("Value") . '</td>';
print '<td align="center">' . $langs->trans("Action") . '</td>';
print "</tr>\n";
$var = true;
// Login/Pass required for members
$var = !$var;
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="constname" value="ADHERENT_LOGIN_NOT_REQUIRED">';
print '<tr ' . $bc[$var] . '><td>' . $langs->trans("AdherentLoginRequired") . '</td><td>';