Merge branch 'develop' of git://github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
philippe grand 2015-11-18 15:45:03 +01:00
commit 209ec62bfe
8 changed files with 79 additions and 51 deletions

View File

@ -5304,7 +5304,7 @@ class Form
$entity = (! empty($object->entity) ? $object->entity : $conf->entity);
$id = (! empty($object->id) ? $object->id : $object->rowid);
$ret='';$dir='';$file='';$altfile='';$email='';
$ret='';$dir='';$file='';$originalfile='';$altfile='';$email='';
if ($modulepart=='societe')
{
@ -5313,9 +5313,11 @@ class Form
$smallfile=preg_replace('/(\.png|\.gif|\.jpg|\.jpeg|\.bmp)/i','_small\\1',$smallfile);
if (! empty($object->logo))
{
// TODO Introduce get_exdir
if ((string) $imagesize == 'mini') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_mini');
else if ((string) $imagesize == 'small') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_small');
else $file=$id.'/logos/thumbs/'.$smallfile;
$originalfile=$id.'/logos/thumbs/'.$smallfile;
}
}
else if ($modulepart=='contact')
@ -5323,9 +5325,11 @@ class Form
$dir=$conf->societe->multidir_output[$entity].'/contact';
if (! empty($object->photo))
{
// TODO Introduce get_exdir
if ((string) $imagesize == 'mini') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_mini');
else if ((string) $imagesize == 'small') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_small');
else $file=$id.'/photos/'.$object->photo;
$originalfile=$id.'/photos/'.$object->photo;
}
}
else if ($modulepart=='userphoto')
@ -5336,6 +5340,7 @@ class Form
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini');
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small');
else $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo;
$originalfile=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo;
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
@ -5348,6 +5353,7 @@ class Form
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
else $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.$object->photo;
$originalfile=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.$object->photo;
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
@ -5360,6 +5366,7 @@ class Form
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini');
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small');
else $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
$originalfile=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
@ -5369,13 +5376,13 @@ class Form
{
if ($file && file_exists($dir."/".$file))
{
if ($addlinktofullsize) $ret.='<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
if ($addlinktofullsize) $ret.='<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
$ret.='<img alt="Photo" id="photologo'.(preg_replace('/[^a-z]/i','_',$file)).'" class="'.$cssclass.'" '.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
if ($addlinktofullsize) $ret.='</a>';
}
else if ($altfile && file_exists($dir."/".$altfile))
{
if ($addlinktofullsize) $ret.='<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
if ($addlinktofullsize) $ret.='<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
$ret.='<img alt="Photo alt" id="photologo'.(preg_replace('/[^a-z]/i','_',$file)).'" class="'.$cssclass.'" '.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($altfile).'&cache='.$cache.'">';
if ($addlinktofullsize) $ret.='</a>';
}

View File

@ -892,7 +892,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
$showimage=$object->is_photo_available($conf->product->multidir_output[$object->entity]);
$maxvisiblephotos=(isset($conf->global->PRODUCT_MAX_VISIBLE_PHOTO)?$conf->global->PRODUCT_MAX_VISIBLE_PHOTO:5);
if ($conf->browser->phone) $maxvisiblephotos=1;
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos($conf->product->multidir_output[$object->entity],1,-$maxvisiblephotos,0,0,0,$width,0).'</div>';
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos($conf->product->multidir_output[$object->entity],'small',-$maxvisiblephotos,0,0,0,$width,0).'</div>';
else
{
$nophoto='/public/theme/common/nophoto.png';
@ -901,7 +901,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
}
else
{
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showphoto($modulepart,$object,0,0,0,'photoref','',1,0,$maxvisiblephotos).'</div>';
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos).'</div>';
}
if ($showbarcode) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>';
if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
@ -5325,7 +5325,7 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
*
* @param string $file Original filename (full or relative path)
* @param string $extName Extension to differenciate thumb file name ('', '_small', '_mini')
* @param string $extImgTarget Force image extension for thumbs. Use '' to keep same extension than original image.
* @param string $extImgTarget Force image extension for thumbs. Use '' to keep same extension than original image. Use '.png' for generated thumb files.
* @return string New file name (full or relative path, including the thumbs/)
*/
function getImageFileNameForSize($file, $extName, $extImgTarget='')

View File

@ -15,6 +15,7 @@
-- To make pk to be auto increment (postgres): VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE
-- To set a field as NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL;
-- To set a field as default NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
-- Note: fields with type BLOB/TEXT can't have default value.
-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user);
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
@ -54,6 +55,11 @@ ALTER TABLE llx_societe_commerciaux ADD COLUMN import_key varchar(14) AFTER fk_u
ALTER TABLE llx_categorie ADD COLUMN color varchar(8);
ALTER TABLE llx_cronjob ADD COLUMN maxrun integer NOT NULL DEFAULT 0;
ALTER TABLE llx_cronjob ADD COLUMN autodelete integer DEFAULT 0;
ALTER TABLE llx_cronjob ADD COLUMN fk_mailing integer DEFAULT NULL;
create table llx_overwrite_trans
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
@ -72,7 +78,7 @@ ALTER TABLE llx_paiement ADD COLUMN ref varchar(30) NOT NULL DEFAULT '' AFTER ro
ALTER TABLE llx_socpeople ADD COLUMN photo varchar(255) AFTER skype;
ALTER TABLE llx_user_param MODIFY COLUMN param varchar(255) NOT NULL DEFAULT '';
ALTER TABLE llx_user_param MODIFY COLUMN value text NOT NULL DEFAULT '';
ALTER TABLE llx_user_param MODIFY COLUMN value text NOT NULL;
ALTER TABLE llx_expedition ADD COLUMN import_key varchar(14);
ALTER TABLE llx_expedition ADD COLUMN extraparams varchar(255);
@ -438,4 +444,4 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('109', 5209, '', 0, '', 'Madre de Dios', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('110', 5209, '', 0, '', 'Manuripi', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('111', 5209, '', 0, '', 'Nicolás Suárez', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('112', 5209, '', 0, '', 'General Federico Román', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('112', 5209, '', 0, '', 'General Federico Román', 1);

View File

@ -26,27 +26,32 @@ CREATE TABLE llx_cronjob
jobtype varchar(10) NOT NULL,
label text NOT NULL,
command varchar(255),
classesname varchar(255),
classesname varchar(255),
objectname varchar(255),
methodename varchar(255),
params text,
md5params varchar(32),
module_name varchar(255),
module_name varchar(255),
priority integer DEFAULT 0,
datelastrun datetime, -- date last run and when should be next
datenextrun datetime, -- job will be run if current date higher that this date
datelastrun datetime, -- date last run and when should be next
datenextrun datetime, -- job will be run if current date higher that this date
datestart datetime, -- before this date no jobs will be run
dateend datetime, -- after this date, no more jobs will be run
datelastresult datetime,
lastresult text,
lastoutput text,
unitfrequency integer NOT NULL DEFAULT 0,
datelastresult datetime,
lastresult text,
lastoutput text,
unitfrequency integer NOT NULL DEFAULT 0,
frequency integer NOT NULL DEFAULT 0,
nbrun integer,
maxrun integer NOT NULL DEFAULT 0, -- set this to 1 for a job queued for on run only
nbrun integer, -- nb of run complete (failed or not)
autodelete integer DEFAULT 0, -- Job can be delete once finished
status integer NOT NULL DEFAULT 1,
fk_user_author integer DEFAULT NULL,
fk_user_mod integer DEFAULT NULL,
note text,
fk_user_author integer DEFAULT NULL,
fk_user_mod integer DEFAULT NULL,
fk_mailing integer DEFAULT NULL, -- id of emailing if job was queued to send mass emailing
note text,
libname varchar(255),
entity integer DEFAULT 0
)ENGINE=innodb;

View File

@ -69,7 +69,7 @@ ProductQtyInCustomersOrdersRunning=Product quantity into opened customers orders
ProductQtyInSuppliersOrdersRunning=Product quantity into opened suppliers orders
ProductQtyInShipmentAlreadySent=Product quantity from opened customer order already sent
ProductQtyInSuppliersShipmentAlreadyRecevied=Product quantity from opened supplier order already received
NoProductToShipFoundIntoStock=No product to ship found into warehouse <b>%s</b>. Correct sotck or go back to choose another warehouse.
NoProductToShipFoundIntoStock=No product to ship found into warehouse <b>%s</b>. Correct stock or go back to choose another warehouse.
# Sending methods
SendingMethodCATCH=Catch by customer

View File

@ -3503,13 +3503,13 @@ class Product extends CommonObject
* TODO Move this into html.formproduct.class.php
*
* @param string $sdir Directory to scan
* @param int $size 0=original size, 1 use thumbnail if possible
* @param int $size 0=original size, 1='small' use thumbnail if possible
* @param int $nbmax Nombre maximum de photos (0=pas de max)
* @param int $nbbyrow Number of image per line or -1 to use div. Used only if size=1.
* @param int $showfilename 1=Show filename
* @param int $showaction 1=Show icon with action links (resize, delete)
* @param int $maxHeight Max height of image when size=1
* @param int $maxWidth Max width of image when size=1
* @param int $maxHeight Max height of original image when size='small' (so we can use original even if small requested). If 0, always use 'small' thumb image.
* @param int $maxWidth Max width of original image when size='small'
* @param int $nolink Do not add a href link to view enlarged imaged into a new tab
* @return string Html code to show photo. Number of photos shown is saved in this->nbphoto
*/
@ -3557,14 +3557,12 @@ class Product extends CommonObject
$photo = $file;
$viewfilename = $file;
if ($size == 1) { // Format vignette
// On determine nom du fichier vignette
$photo_vignette='';
if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $photo, $regs)) {
$photo_vignette=preg_replace('/'.$regs[0].'/i', '', $photo)."_small".$regs[0];
if (! dol_is_file($dirthumb.$photo_vignette)) $photo_vignette='';
}
if ($size == 1 || $size == 'small') { // Format vignette
// Find name of thumb file
$photo_vignette=basename(getImageFileNameForSize($dir.$file, '_small', '.png'));
if (! dol_is_file($dirthumb.$photo_vignette)) $photo_vignette='';
// Get filesize of original file
$imgarray=dol_getImageSize($dir.$photo);
@ -3584,7 +3582,8 @@ class Product extends CommonObject
// Si fichier vignette disponible et image source trop grande, on utilise la vignette, sinon on utilise photo origine
$alt=$langs->transnoentitiesnoconv('File').': '.$pdir.$photo;
$alt.=' - '.$langs->transnoentitiesnoconv('Size').': '.$imgarray['width'].'x'.$imgarray['height'];
if ($photo_vignette && $imgarray['height'] > $maxHeight)
if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight)
{
$return.= '<!-- Show thumb -->';
$return.= '<img class="photo photowithmargin" border="0" '.($conf->dol_use_jmobile?'max-height':'height').'="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdirthumb.$photo_vignette).'" title="'.dol_escape_htmltag($alt).'">';
@ -3626,7 +3625,7 @@ class Product extends CommonObject
else if ($nbbyrow < 0) $return.='</div>';
}
if ($size == 0) { // Format origine
if (empty($size)) { // Format origine
$return.= '<img class="photo photowithmargin" border="0" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'">';
if ($showfilename) $return.= '<br>'.$viewfilename;
@ -3650,7 +3649,7 @@ class Product extends CommonObject
}
}
if ($size==1)
if ($size==1 || $size='small')
{
if ($nbbyrow > 0)
{

View File

@ -215,7 +215,7 @@ print '*/'."\n";
if (! empty($conf->dol_optimize_smallscreen)) $fontsize=11;
//$nb=$menumanager->showmenu('topnb');
$nbtopmenuentries=$menumanager->showmenu('topnb');
//print $nb;
?>
@ -3871,6 +3871,17 @@ border-top-right-radius: 6px;
padding: 0 4px 0 4px;
}
@media only screen and (max-width: 767px)
{
.imgopensurveywizard { width:95%; height: auto; }
#tooltip {
position: absolute;
width: <?php print dol_size(350,'width'); ?>px;
}
}
@media only screen and (max-width: <?php echo $nbtopmenuentries * 85; ?>px)
{
.mainmenuaspan {
display: none;
@ -3888,13 +3899,6 @@ border-top-right-radius: 6px;
div.tmenuleft {
display: none;
}
.imgopensurveywizard { width:95%; height: auto; }
#tooltip {
position: absolute;
width: <?php print dol_size(350,'width'); ?>px;
}
}
@media only screen and (max-width: 570px)
{
@ -3910,7 +3914,8 @@ border-top-right-radius: 6px;
<?php } ?>
}
div.login_block {
top: 9px;
top: 4px;
max-width: 82px;
}
div.mainmenu {

View File

@ -32,7 +32,7 @@ if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
if (! defined('NOLOGIN')) define('NOLOGIN',1); // File must be accessed by logon page so without login
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
@ -209,6 +209,9 @@ print 'dol_screenheight='.$_SESSION['dol_screenheight']."\n";
print '*/'."\n";
if (! empty($conf->dol_optimize_smallscreen)) $fontsize=11;
$nbtopmenuentries=$menumanager->showmenu('topnb');
?>
/* ============================================================================== */
@ -3711,6 +3714,16 @@ border-top-right-radius: 6px;
padding: 0 4px 0 4px;
}
@media only screen and (max-width: 767px)
{
.imgopensurveywizard { width:95%; height: auto; }
#tooltip {
position: absolute;
width: <?php print dol_size(350,'width'); ?>px;
}
}
@media only screen and (max-width: <?php echo ($nbtopmenuentries * 85) + 200; ?>px)
{
.mainmenuaspan {
display: none;
@ -3728,13 +3741,6 @@ border-top-right-radius: 6px;
div.tmenuleft {
display: none;
}
.imgopensurveywizard { width:95%; height: auto; }
#tooltip {
position: absolute;
width: <?php print dol_size(350,'width'); ?>px;
}
}
@media only screen and (max-width: 570px)
{