Example #1
0
$id = $_GET["id"];
$ref= $_GET["ref"];
if ($id > 0 || ! empty($ref))
{
	if ($mesg) print $mesg;

	$now=gmmktime();

	$propal = new Propal($db);
	if ($propal->fetch($id, $ref))
	{
		$societe = new Societe($db);
		if ( $societe->fetch($propal->socid) )
		{
			$head = propal_prepare_head($propal);
			dol_fiche_head($head, 'note', $langs->trans('Proposal'), 0, 'propal');

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

			$linkback="<a href=\"".$_SERVER["PHP_SELF"]."?page=$page&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder\">".$langs->trans("BackToList")."</a>";

			// Ref
			print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
			print $html->showrefnav($propal,'ref',$linkback,1,'ref','ref','');
			print '</td></tr>';

			// Ref client
			print '<tr><td>';
			print '<table class="nobordernopadding" width="100%"><tr><td nowrap>';
			print $langs->trans('RefCustomer').'</td><td align="left">';
Example #2
0
$now=gmmktime();

$id = $_GET["id"];
$ref= $_GET["ref"];
if ($id > 0 || ! empty($ref))
{
	if ($mesg) print "$mesg<br>";

	$product_static=new Product($db);

	$object->fetch($_GET["id"],$_GET["ref"]);

	$societe = new Societe($db);
	$societe->fetch($object->socid);

	$head = propal_prepare_head($object);
	dol_fiche_head($head, 'compta', $langs->trans('Proposal'), 0, 'propal');


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

	$linkback="<a href=\"".$_SERVER["PHP_SELF"]."?page=$page&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder\">".$langs->trans("BackToList")."</a>";

	// Ref
	print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="5">';
	print $html->showrefnav($object,'ref',$linkback,1,'ref','ref','');
	print '</td></tr>';
function fiche_import(&$object, $error)
{
    global $langs, $user;
    $origin = GETPOST('origin');
    $head = null;
    if ($origin == 'propal') {
        $head = propal_prepare_head($object);
    } else {
        $head = commande_prepare_head($object);
    }
    if (empty($user->rights->importdevis->myactions)) {
        accessforbidden();
    } else {
        llxHeader();
        $title = $langs->trans('Import');
        if ($origin == 'propal') {
            dol_fiche_head($head, 'importdevis', $title, 0, 'propal');
        } else {
            dol_fiche_head($head, 'importdevis', $title, 0, 'commande');
        }
        ?>
		
		<table width="100%" class="border">
			<tr>
				<td width="25%"><?php 
        echo $langs->trans('Ref');
        ?>
</td>
				<td colspan="3"><div style="vertical-align: middle"><div class="inline-block floatleft refid"><?php 
        echo $object->ref;
        ?>
</div></div></td>
			</tr>
			<tr>
				<td><?php 
        echo $langs->trans('Company');
        ?>
</td>
				<td colspan="3"><?php 
        echo $object->thirdparty->getNomUrl(1);
        ?>
</td>
			</tr>
			<?php 
        if (!$error) {
            ?>
			<tr>
				<td><?php 
            echo $langs->trans('FileToImport');
            ?>
</td>
				<td>
					<form action="<?php 
            echo $_SERVER['PHP_SELF'];
            ?>
" method="POST" enctype="multipart/form-data">
						<input name="action" type="hidden" value="send_file" />
						<input name="id" type="hidden" value="<?php 
            echo $object->id;
            ?>
" />
						<input name="origin" type="hidden" value="<?php 
            echo $origin;
            ?>
"/>
						<input name="token" type="hidden" value="<?php 
            echo $_SESSION['newtoken'];
            ?>
" />
						
						<input name="fileDGPF" type="file" />
						<?php 
            echo $langs->trans('NbLineToAvoid');
            ?>
 <input name="nb_line_to_avoid" type="number" value="<?php 
            echo (int) $conf->global->IMPORTPROPAL_NB_LINE_TO_AVOID;
            ?>
" size="2" />
						
						<input class="button" type="submit" value="<?php 
            echo $langs->trans('SendFile');
            ?>
" />
					</form>
				</td>
			</tr>
			<?php 
        }
        ?>
		</table>
	    	
    	<?php 
        dol_fiche_end();
        llxFooter();
    }
}