Merge tab to upload photo and other files to same tab. This reduce
duplicate code and avoid users to be lost.
This commit is contained in:
parent
b5cc7ae1c8
commit
20da120a49
@ -857,9 +857,16 @@ class FormFile
|
|||||||
{
|
{
|
||||||
if (image_format_supported($file['name']) > 0)
|
if (image_format_supported($file['name']) > 0)
|
||||||
{
|
{
|
||||||
// TODO Add link from photo page here
|
$permtoedit=0;
|
||||||
|
if ($user->rights->produit->creer && $object->type == Product::TYPE_PRODUCT) $permtoedit=1;
|
||||||
|
if ($user->rights->service->creer && $object->type == Product::TYPE_SERVICE) $permtoedit=1;
|
||||||
|
if (empty($conf->global->MAIN_UPLOAD_DOC)) $permtoedit=0;
|
||||||
|
|
||||||
|
if ($permtoedit)
|
||||||
|
{
|
||||||
|
// Link to resize
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/core/photos_resize.php?modulepart='.urlencode('produit|service').'&id='.$object->id.'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])).'" title="'.dol_escape_htmltag($langs->trans("Resize")).'">'.img_picto($langs->trans("Resize"),DOL_URL_ROOT.'/theme/common/transform-crop-and-resize','',1).'</a> ';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($permtodelete)
|
if ($permtodelete)
|
||||||
|
|||||||
@ -40,11 +40,3 @@ function updateCoords(c)
|
|||||||
jQuery('#w').val(Math.ceil(c.w * ratio));
|
jQuery('#w').val(Math.ceil(c.w * ratio));
|
||||||
jQuery('#h').val(Math.ceil(c.h * ratio));
|
jQuery('#h').val(Math.ceil(c.h * ratio));
|
||||||
};
|
};
|
||||||
|
|
||||||
/* checkCoords */
|
|
||||||
function checkCoords()
|
|
||||||
{
|
|
||||||
if (parseInt(jQuery('#w').val())) return true;
|
|
||||||
alert('Please select a crop region then press submit.');
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|||||||
@ -114,10 +114,12 @@ function product_prepare_head($object)
|
|||||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'product');
|
complete_head_from_modules($conf,$langs,$object,$head,$h,'product');
|
||||||
|
|
||||||
|
/* Merged into the Join files tab
|
||||||
$head[$h][0] = DOL_URL_ROOT."/product/photos.php?id=".$object->id;
|
$head[$h][0] = DOL_URL_ROOT."/product/photos.php?id=".$object->id;
|
||||||
$head[$h][1] = $langs->trans("Photos");
|
$head[$h][1] = $langs->trans("Photos");
|
||||||
$head[$h][2] = 'photos';
|
$head[$h][2] = 'photos';
|
||||||
$h++;
|
$h++;
|
||||||
|
*/
|
||||||
|
|
||||||
// Attachments
|
// Attachments
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2010-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2009 Meos
|
* Copyright (C) 2009 Meos
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
@ -46,6 +46,8 @@ $id=GETPOST('id','int');
|
|||||||
$action=GETPOST('action','alpha');
|
$action=GETPOST('action','alpha');
|
||||||
$modulepart=GETPOST('modulepart','alpha')?GETPOST('modulepart','alpha'):'produit|service';
|
$modulepart=GETPOST('modulepart','alpha')?GETPOST('modulepart','alpha'):'produit|service';
|
||||||
$original_file = isset($_REQUEST["file"])?urldecode($_REQUEST["file"]):'';
|
$original_file = isset($_REQUEST["file"])?urldecode($_REQUEST["file"]):'';
|
||||||
|
$backtourl=GETPOST('backtourl');
|
||||||
|
$cancel=GETPOST("cancel");
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (empty($modulepart)) accessforbidden('Bad value for modulepart');
|
if (empty($modulepart)) accessforbidden('Bad value for modulepart');
|
||||||
@ -78,6 +80,20 @@ if ($id > 0)
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if ($cancel)
|
||||||
|
{
|
||||||
|
if ($backtourl)
|
||||||
|
{
|
||||||
|
header("Location: ".$backtourl);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
header("Location: ".DOL_URL_ROOT."/product/document.php?id=".$id.'&file='.urldecode($_POST["file"]));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($action == 'confirm_resize' && (isset($_POST["file"]) != "") && (isset($_POST["sizex"]) != "") && (isset($_POST["sizey"]) != ""))
|
if ($action == 'confirm_resize' && (isset($_POST["file"]) != "") && (isset($_POST["sizex"]) != "") && (isset($_POST["sizey"]) != ""))
|
||||||
{
|
{
|
||||||
$fullpath=$dir."/".$original_file;
|
$fullpath=$dir."/".$original_file;
|
||||||
@ -85,13 +101,24 @@ if ($action == 'confirm_resize' && (isset($_POST["file"]) != "") && (isset($_POS
|
|||||||
|
|
||||||
if ($result == $fullpath)
|
if ($result == $fullpath)
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT."/product/photos.php?id=".$id.'&action=addthumb&file='.urldecode($_POST["file"]));
|
$object->add_thumb($fullpath);
|
||||||
exit;
|
|
||||||
|
if ($backtourl)
|
||||||
|
{
|
||||||
|
header("Location: ".$backtourl);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
header("Location: ".DOL_URL_ROOT."/product/document.php?id=".$id.'&file='.urldecode($_POST["file"]));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mesg=$result;
|
setEventMessage($result, 'errors');
|
||||||
$_GET['file']=$_POST["file"];
|
$_GET['file']=$_POST["file"];
|
||||||
|
$action='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,13 +130,24 @@ if ($action == 'confirm_crop')
|
|||||||
|
|
||||||
if ($result == $fullpath)
|
if ($result == $fullpath)
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT."/product/photos.php?id=".$id.'&action=addthumb&file='.urldecode($_POST["file"]));
|
$object->add_thumb($fullpath);
|
||||||
exit;
|
|
||||||
|
if ($backtourl)
|
||||||
|
{
|
||||||
|
header("Location: ".$backtourl);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
header("Location: ".DOL_URL_ROOT."/product/document.php?id=".$id.'&file='.urldecode($_POST["file"]));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mesg=$result;
|
setEventMessage($result, 'errors');
|
||||||
$_GET['file']=$_POST["file"];
|
$_GET['file']=$_POST["file"];
|
||||||
|
$action='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,8 +161,6 @@ llxHeader($head, $langs->trans("Image"), '', '', 0, 0, array('/includes/jquery/p
|
|||||||
|
|
||||||
print_fiche_titre($langs->trans("ImageEditor"));
|
print_fiche_titre($langs->trans("ImageEditor"));
|
||||||
|
|
||||||
if ($mesg) print '<div class="error">'.$mesg.'</div>';
|
|
||||||
|
|
||||||
$infoarray=dol_getImageSize($dir."/".urldecode($_GET["file"]));
|
$infoarray=dol_getImageSize($dir."/".urldecode($_GET["file"]));
|
||||||
$height=$infoarray['height'];
|
$height=$infoarray['height'];
|
||||||
$width=$infoarray['width'];
|
$width=$infoarray['width'];
|
||||||
@ -133,6 +169,11 @@ print $langs->trans("Width").': <strong>'.$width.'</strong> x '.$langs->trans("H
|
|||||||
|
|
||||||
print '<br>'."\n";
|
print '<br>'."\n";
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Resize image
|
||||||
|
*/
|
||||||
|
|
||||||
print '<!-- Form to resize -->'."\n";
|
print '<!-- Form to resize -->'."\n";
|
||||||
print '<form name="redim_file" action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="POST">';
|
print '<form name="redim_file" action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="POST">';
|
||||||
|
|
||||||
@ -145,11 +186,15 @@ print '<input type="hidden" name="file" value="'.$_GET['file'].'" />';
|
|||||||
print '<input type="hidden" name="action" value="confirm_resize" />';
|
print '<input type="hidden" name="action" value="confirm_resize" />';
|
||||||
print '<input type="hidden" name="product" value="'.$id.'" />';
|
print '<input type="hidden" name="product" value="'.$id.'" />';
|
||||||
print '<input type="hidden" name="id" value="'.$id.'" />';
|
print '<input type="hidden" name="id" value="'.$id.'" />';
|
||||||
print '<br><input class="button" name="sendit" value="'.dol_escape_htmltag($langs->trans("Resize")).'" type="submit" />';
|
print '<br>';
|
||||||
|
print '<input class="button" id="submitresize" name="sendit" value="'.dol_escape_htmltag($langs->trans("Resize")).'" type="submit" />';
|
||||||
|
print ' ';
|
||||||
|
print '<input type="submit" id="cancelresize" name="cancel" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" />';
|
||||||
print '</fieldset>'."\n";
|
print '</fieldset>'."\n";
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '<br>'."\n";
|
print '<br>'."\n";
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Crop image
|
* Crop image
|
||||||
*/
|
*/
|
||||||
@ -178,7 +223,7 @@ if (! empty($conf->use_javascript_ajax))
|
|||||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$object->entity.'&file='.$original_file.'" alt="" id="cropbox" width="'.$widthforcrop.'px"/>';
|
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$object->entity.'&file='.$original_file.'" alt="" id="cropbox" width="'.$widthforcrop.'px"/>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</div><br>';
|
print '</div><br>';
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="post" onsubmit="return checkCoords();">
|
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="post">
|
||||||
<div class="jc_coords">
|
<div class="jc_coords">
|
||||||
'.$langs->trans("NewSizeAfterCropping").':
|
'.$langs->trans("NewSizeAfterCropping").':
|
||||||
<label>X1 <input type="text" size="4" id="x" name="x" /></label>
|
<label>X1 <input type="text" size="4" id="x" name="x" /></label>
|
||||||
@ -195,12 +240,26 @@ if (! empty($conf->use_javascript_ajax))
|
|||||||
<input type="hidden" id="refsizeforcrop" name="refsizeforcrop" value="'.$refsizeforcrop.'" />
|
<input type="hidden" id="refsizeforcrop" name="refsizeforcrop" value="'.$refsizeforcrop.'" />
|
||||||
<input type="hidden" id="ratioforcrop" name="ratioforcrop" value="'.$ratioforcrop.'" />
|
<input type="hidden" id="ratioforcrop" name="ratioforcrop" value="'.$ratioforcrop.'" />
|
||||||
<input type="hidden" name="id" value="'.$id.'" />
|
<input type="hidden" name="id" value="'.$id.'" />
|
||||||
<br><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Recenter")).'" />
|
<br>
|
||||||
|
<input type="submit" id="submitcrop" name="submitcrop" class="button" value="'.dol_escape_htmltag($langs->trans("Recenter")).'" />
|
||||||
|
|
||||||
|
<input type="submit" id="cancelcrop" name="cancel" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" />
|
||||||
</form>'."\n";
|
</form>'."\n";
|
||||||
print '</fieldset>'."\n";
|
print '</fieldset>'."\n";
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check that mandatory fields are filled */
|
||||||
|
print '<script type="text/javascript" language="javascript">
|
||||||
|
jQuery(document).ready(function() {
|
||||||
|
$("#submitcrop").click(function(e) {
|
||||||
|
var idClicked = e.target.id;
|
||||||
|
if (parseInt(jQuery(\'#w\').val())) return true;
|
||||||
|
alert(\''.dol_escape_js($langs->trans("ErrorFieldRequired", $langs->trans("Dimension"))).'\');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -1,215 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
||||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
||||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.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/product/photos.php
|
|
||||||
* \ingroup product
|
|
||||||
* \brief Onglet photos de la fiche produit
|
|
||||||
*/
|
|
||||||
|
|
||||||
require '../main.inc.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
|
||||||
|
|
||||||
$langs->load("products");
|
|
||||||
$langs->load("bills");
|
|
||||||
|
|
||||||
$id = GETPOST('id', 'int');
|
|
||||||
$ref = GETPOST('ref', 'alpha');
|
|
||||||
$action = GETPOST('action', 'alpha');
|
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
|
||||||
|
|
||||||
// Security check
|
|
||||||
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
|
|
||||||
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
|
||||||
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
|
||||||
|
|
||||||
$mesg = '';
|
|
||||||
|
|
||||||
$object = new Product($db);
|
|
||||||
if ($id > 0 || ! empty($ref))
|
|
||||||
{
|
|
||||||
$result = $object->fetch($id, $ref);
|
|
||||||
$dir = (! empty($conf->product->multidir_output[$object->entity])?$conf->product->multidir_output[$object->entity]:$conf->service->multidir_output[$object->entity]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Actions
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (isset($_FILES['userfile']) && $_FILES['userfile']['size'] > 0 && GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|
||||||
{
|
|
||||||
if ($object->id)
|
|
||||||
{
|
|
||||||
if (image_format_supported($_FILES['userfile']['name']) >= 1)
|
|
||||||
{
|
|
||||||
$result = $object->add_photo($dir, $_FILES['userfile']);
|
|
||||||
if ($result > 0) setEventMessage($langs->trans("FileUploaded"));
|
|
||||||
else setEventMessage($langs->trans("FileNotUploaded"), 'errors');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$langs->load("errors");
|
|
||||||
setEventMessage($langs->trans("ErrorBadImageFormat"), 'errors');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($action == 'confirm_delete' && $_GET["file"] && $confirm == 'yes' && ($user->rights->produit->creer || $user->rights->service->creer))
|
|
||||||
{
|
|
||||||
$object->delete_photo($dir."/".$_GET["file"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
|
||||||
$titre=$langs->trans("CardProduct".$object->type);
|
|
||||||
$picto=($object->type== Product::TYPE_SERVICE?'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
|
|
||||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$object->label.'</td>';
|
|
||||||
print '</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 "</table>\n";
|
|
||||||
|
|
||||||
print "</div>\n";
|
|
||||||
|
|
||||||
|
|
||||||
$permtoedit=0;
|
|
||||||
if ($user->rights->produit->creer && $object->type == Product::TYPE_PRODUCT) $permtoedit=1;
|
|
||||||
if ($user->rights->service->creer && $object->type == Product::TYPE_SERVICE) $permtoedit=1;
|
|
||||||
if (empty($conf->global->MAIN_UPLOAD_DOC)) $permtoedit=0;
|
|
||||||
|
|
||||||
/* ************************************************************************** */
|
|
||||||
/* */
|
|
||||||
/* Barre d'action */
|
|
||||||
/* */
|
|
||||||
/* ************************************************************************** */
|
|
||||||
/*
|
|
||||||
print "\n<div class=\"tabsAction\">\n";
|
|
||||||
|
|
||||||
if ($action != 'ajout_photo' && ($user->rights->produit->creer || $user->rights->service->creer))
|
|
||||||
{
|
|
||||||
if (! empty($conf->global->MAIN_UPLOAD_DOC))
|
|
||||||
{
|
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=ajout_photo&id='.$object->id.'">';
|
|
||||||
print $langs->trans("AddPhoto").'</a>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<a class="butActionRefused" href="#">e';
|
|
||||||
print $langs->trans("AddPhoto").'</a>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print "\n</div>\n";
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* Add a photo
|
|
||||||
*/
|
|
||||||
if ($permtoedit)
|
|
||||||
{
|
|
||||||
// Show upload form
|
|
||||||
$formfile=new FormFile($db);
|
|
||||||
$formfile->form_attach_new_file($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("AddPhoto"), 1, 0, $permtoedit, 50, $object, '', false, '', 0); // ajax=false for the moment. true may not work.
|
|
||||||
}
|
|
||||||
//else print $langs->trans("NoPermissionToAddOrEditPhoto").'<br><br>'; // TODO Add this
|
|
||||||
|
|
||||||
// Affiche photos
|
|
||||||
if ($action != 'ajout_photo')
|
|
||||||
{
|
|
||||||
$nbphoto=0;
|
|
||||||
$nbbyrow=5;
|
|
||||||
|
|
||||||
$maxWidth = 160;
|
|
||||||
$maxHeight = 120;
|
|
||||||
|
|
||||||
print $object->show_photos($dir,1,1000,$nbbyrow,1,($permtoedit?1:0));
|
|
||||||
|
|
||||||
if ($object->nbphoto < 1)
|
|
||||||
{
|
|
||||||
print '<table width="100%" valign="top" align="center" border="0" cellpadding="2" cellspacing="2">';
|
|
||||||
print '<tr align=center valign=middle border=1><td class="photo">';
|
|
||||||
print "<br>".$langs->trans("NoPhotoYet")."<br><br>";
|
|
||||||
print '</td></tr>';
|
|
||||||
print '</table>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print $langs->trans("ErrorUnknown");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
|
||||||
$db->close();
|
|
||||||
@ -2043,6 +2043,16 @@ div.pagination li.pagination span {
|
|||||||
line-height: 1.42857143;
|
line-height: 1.42857143;
|
||||||
color: #000;
|
color: #000;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
||||||
|
border-color: #ccc;
|
||||||
|
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
|
||||||
|
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
|
||||||
|
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
|
||||||
|
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
|
||||||
|
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
|
||||||
|
background-repeat: repeat-x;
|
||||||
}
|
}
|
||||||
div.pagination li.pagination span.inactive {
|
div.pagination li.pagination span.inactive {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
@ -2086,7 +2096,15 @@ div.pagination li a:focus,
|
|||||||
div.pagination li span:focus {
|
div.pagination li span:focus {
|
||||||
color: #000;
|
color: #000;
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
border-color: #ddd;
|
border-color: #ccc;
|
||||||
|
|
||||||
|
background-image: -moz-linear-gradient(top, #eee, #ddd);
|
||||||
|
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#ddd));
|
||||||
|
background-image: -webkit-linear-gradient(top, #eee, #ddd);
|
||||||
|
background-image: -o-linear-gradient(top, #eee, #ddd);
|
||||||
|
background-image: linear-gradient(to bottom, #eee, #ddd);
|
||||||
|
background-repeat: repeat-x;
|
||||||
|
|
||||||
}
|
}
|
||||||
div.pagination li .active a,
|
div.pagination li .active a,
|
||||||
div.pagination li .active span,
|
div.pagination li .active span,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user