[CORE] suppression de fichiers inutile (#new_ask_price).
This commit is contained in:
parent
a3c29f2e9c
commit
4ec611e4b9
@ -1,221 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Frederic France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/comm/propal/apercu.php
|
||||
* \ingroup propal
|
||||
* \brief Preview tab of propal
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/askpricesupplier/class/askpricesupplier.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/askpricesupplier.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$langs->load('askpricesupplier');
|
||||
$langs->load("bills");
|
||||
$langs->load('compta');
|
||||
|
||||
// Security check
|
||||
$socid=0;
|
||||
$id = GETPOST('id','int');
|
||||
$ref = GETPOST("ref");
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'askpricesupplier', $id);
|
||||
|
||||
|
||||
/*
|
||||
* View Mode
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$object = new AskPriceSupplier($db);
|
||||
|
||||
if ($object->fetch($id,$ref) > 0)
|
||||
{
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($object->socid);
|
||||
|
||||
$head = propal_prepare_head($object);
|
||||
dol_fiche_head($head, 'preview', $langs->trans('CommRequest'), 0, 'askpricesupplier');
|
||||
|
||||
|
||||
/*
|
||||
* Propal
|
||||
*/
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="25%">'.$langs->trans('Ref').'</td>';
|
||||
print '<td colspan="5">'.$object->ref.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Ref client
|
||||
print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
|
||||
print '<td colspan="5">'.$object->ref_client.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Thirdparty
|
||||
print '<tr><td>'.$langs->trans('Company').'</td>';
|
||||
print '<td colspan="5">'.$soc->getNomUrl(1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td>';
|
||||
print '<td colspan="5">'.$object->getLibStatut(4).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Discount
|
||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">';
|
||||
if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent);
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
$absolute_discount=$soc->getAvailableDiscounts();
|
||||
print '. ';
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->currency));
|
||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
print '.</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date
|
||||
print '<tr><td>'.$langs->trans('Date').'</td>';
|
||||
print '<td>'.dol_print_date($object->date,'daytext').'</td>';
|
||||
|
||||
// Right part with $rowspan lines
|
||||
$rowspan=4;
|
||||
print '<td rowspan="'.$rowspan.'" valign="top" width="50%">';
|
||||
|
||||
/*
|
||||
* Documents
|
||||
*/
|
||||
$objectref = dol_sanitizeFileName($object->ref);
|
||||
$dir_output = $conf->propal->dir_output . "/";
|
||||
$filepath = $dir_output . $objectref . "/";
|
||||
$file = $filepath . $objectref . ".pdf";
|
||||
$filedetail = $filepath . $objectref . "-detail.pdf";
|
||||
$relativepath = $objectref.'/'.$objectref.'.pdf';
|
||||
$relativepathdetail = $objectref.'/'.$objectref.'-detail.pdf';
|
||||
|
||||
// Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png")
|
||||
$fileimage = $file.'_preview.png'; // If PDF has 1 page
|
||||
$fileimagebis = $file.'_preview-0.pdf.png'; // If PDF has more than one page
|
||||
$relativepathimage = $relativepath.'_preview.png';
|
||||
|
||||
$var=true;
|
||||
|
||||
// Si fichier PDF existe
|
||||
if (file_exists($file))
|
||||
{
|
||||
$encfile = urlencode($file);
|
||||
print '<table class="nobordernopadding" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Documents").'</td></tr>';
|
||||
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("CommRequest").' PDF</td>';
|
||||
|
||||
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepath).'">'.$object->ref.'.pdf</a></td>';
|
||||
|
||||
print '<td align="right">'.dol_print_size(dol_filesize($file)).'</td>';
|
||||
print '<td align="right">'.dol_print_date(dol_filemtime($file),'dayhour').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
// Conversion du PDF en image png si fichier png non existant
|
||||
if (! file_exists($fileimage) && ! file_exists($fileimagebis))
|
||||
{
|
||||
if (class_exists("Imagick"))
|
||||
{
|
||||
$ret = dol_convert_file($file,'png',$fileimage);
|
||||
if ($ret < 0) $error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
print '<font class="error">'.$langs->trans("ErrorNoImagickReadimage").'</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Total HT - left part
|
||||
print '<tr><td>'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td align="right" class="nowrap"><b>' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Total VAT - left part
|
||||
print '<tr><td>'.$langs->trans('AmountVAT').'</td>';
|
||||
print '<td align="right" class="nowrap"><b>' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Total TTC - left part
|
||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td>';
|
||||
print '<td align="right" class="nowrap"><b>' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Propal non trouvee
|
||||
print $langs->trans("ErrorPropalNotFound",$_GET["id"]);
|
||||
}
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td>';
|
||||
print '<div class="photolist">';
|
||||
// Si fichier png PDF d'1 page trouve
|
||||
if (file_exists($fileimage))
|
||||
{
|
||||
print '<img class="photo photowithmargin" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($relativepathimage).'">';
|
||||
}
|
||||
// Si fichier png PDF de plus d'1 page trouve
|
||||
elseif (file_exists($fileimagebis))
|
||||
{
|
||||
$multiple = preg_replace('/\.png/','',$relativepath) . "-";
|
||||
|
||||
for ($i = 0; $i < 20; $i++)
|
||||
{
|
||||
$preview = $multiple.$i.'.png';
|
||||
|
||||
if (file_exists($dir_output.$preview))
|
||||
{
|
||||
print '<img class="photo photowithmargin" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($preview).'"><p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
@ -1,223 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
|
||||
* Copyright (C) 2005-2009 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/comm/propal/contact.php
|
||||
* \ingroup propal
|
||||
* \brief Onglet de gestion des contacts de propal
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/askpricesupplier/class/askpricesupplier.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/askpricesupplier.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
|
||||
$langs->load("facture");
|
||||
$langs->load("orders");
|
||||
$langs->load("sendings");
|
||||
$langs->load("companies");
|
||||
|
||||
$id=GETPOST('id','int');
|
||||
$ref= GETPOST('ref','alpha');
|
||||
$lineid=GETPOST('lineid','int');
|
||||
$action=GETPOST('action','alpha');
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'askpricesupplier', $id);
|
||||
|
||||
$object = new AskPriceSupplier($db);
|
||||
|
||||
// Load object
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$ret=$object->fetch($id, $ref);
|
||||
if ($ret == 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans('ErrorRecordNotFound'), 'errors');
|
||||
$error++;
|
||||
}
|
||||
else if ($ret < 0)
|
||||
{
|
||||
setEventMessage($object->error, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
}
|
||||
else
|
||||
{
|
||||
header('Location: '.DOL_URL_ROOT.'/comm/askpricesupplier/list.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Ajout d'un nouveau contact
|
||||
*/
|
||||
|
||||
if ($action == 'addcontact' && $user->rights->askpricesupplier->creer)
|
||||
{
|
||||
if ($object->id > 0)
|
||||
{
|
||||
$contactid = (GETPOST('userid','int') ? GETPOST('userid','int') : GETPOST('contactid','int'));
|
||||
$result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
|
||||
}
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Bascule du statut d'un contact
|
||||
else if ($action == 'swapstatut' && $user->rights->askpricesupplier->creer)
|
||||
{
|
||||
if ($object->id > 0)
|
||||
{
|
||||
$result=$object->swapContactStatus(GETPOST('ligne'));
|
||||
}
|
||||
}
|
||||
|
||||
// Efface un contact
|
||||
else if ($action == 'deletecontact' && $user->rights->askpricesupplier->creer)
|
||||
{
|
||||
$result = $object->delete_contact($lineid);
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setaddress' && $user->rights->askpricesupplier->creer)
|
||||
{
|
||||
$result=$object->setDeliveryAddress($_POST['fk_address']);
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('',$langs->trans('CommRequest'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
|
||||
|
||||
$form = new Form($db);
|
||||
$formcompany= new FormCompany($db);
|
||||
$formother = new FormOther($db);
|
||||
|
||||
if ($object->id > 0)
|
||||
{
|
||||
$head = askpricesupplier_prepare_head($object);
|
||||
dol_fiche_head($head, 'contact', $langs->trans("CommRequest"), 0, 'askpricesupplier');
|
||||
|
||||
/*
|
||||
* Propal synthese pour rappel
|
||||
*/
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/comm/askpricesupplier/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>';
|
||||
|
||||
// Ref client
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
||||
print $langs->trans('RefCustomer').'</td><td align="left">';
|
||||
print '</td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
print $object->ref_client;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Customer
|
||||
print "<tr><td>".$langs->trans("Company")."</td>";
|
||||
print '<td colspan="3">'.$object->client->getNomUrl(1).'</td></tr>';
|
||||
|
||||
// Delivery address
|
||||
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT))
|
||||
{
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DeliveryAddress');
|
||||
print '</td>';
|
||||
|
||||
if ($action != 'editdelivery_address' && ! empty($object->brouillon))
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_address&socid='.$object->socid.'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
|
||||
if ($action == 'editdelivery_address')
|
||||
{
|
||||
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'fk_address','askpricesupplier',$object->id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'none','askpricesupplier',$object->id);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Contacts lines (modules that overwrite templates must declare this into descriptor)
|
||||
$dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
|
||||
foreach($dirtpls as $reldir)
|
||||
{
|
||||
$res=@include dol_buildpath($reldir.'/contacts.tpl.php');
|
||||
if ($res) break;
|
||||
}
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
Loading…
Reference in New Issue
Block a user