diff --git a/.gitignore b/.gitignore index aa332681474..6aa74f44ed0 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ htdocs/includes/autoload.php htdocs/includes/bin/ htdocs/includes/composer/ /.pydevproject +/dolibarr_genesis.mp4 diff --git a/build/gource/README.md b/build/gource/README.md new file mode 100644 index 00000000000..548d01ebccb --- /dev/null +++ b/build/gource/README.md @@ -0,0 +1,10 @@ +# Command to run gource on Dolibarr git project. + +cd ~/git/dolibarr +gource -a 0.5 -c 4 -i 0 --max-files 0 --dir-name-depth 2 --max-file-lag 0.1 --max-user-speed 150 --user-friction 1 --user-scale 3 --file-filter svgs --file-filter _source --file-filter tests --file-show-filter htdocs --date-format "%d %b %Y" -logo doc/images/appicon_64.png --highlight-users --highlight-colour FFFF88 -s 0.5 -1280x720 -r 25 -title 'Dolibarr ERP CRM Genesis' --stop-at-end --filename-time 2 --user-image-dir build/gource/avatars --hide filenames + + +# To build a mp4 video +# Change -crf 1 to -crf 50 for max compression (best is 5) +cd ~/git/dolibarr +gource -a 0.5 -c 4 -i 0 --max-files 0 --dir-name-depth 2 --max-file-lag 0.1 --max-user-speed 150 --user-friction 1 --user-scale 3 --file-filter svgs --file-filter _source --file-filter tests --file-show-filter htdocs --date-format "%d %b %Y" -logo doc/images/appicon_64.png --highlight-users --highlight-colour FFFF88 -s 0.4 -1280x720 -r 25 -title 'Dolibarr ERP CRM Genesis' --stop-at-end --filename-time 2 --user-image-dir build/gource/avatars --hide filenames -o - | ffmpeg -y -r 25 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset slow -pix_fmt yuv420p -crf 5 -threads 0 -bf 0 dolibarr_genesis.mp4 diff --git a/build/gource/avatars/.gitignore b/build/gource/avatars/.gitignore new file mode 100644 index 00000000000..b44ef384e2d --- /dev/null +++ b/build/gource/avatars/.gitignore @@ -0,0 +1 @@ +/*.png diff --git a/build/gource/avatars/README.md b/build/gource/avatars/README.md new file mode 100644 index 00000000000..c0b3c6d79af --- /dev/null +++ b/build/gource/avatars/README.md @@ -0,0 +1 @@ +Directory that will be filled with avatars images of developers for gource \ No newline at end of file diff --git a/build/gource/getavatars.pl b/build/gource/getavatars.pl new file mode 100755 index 00000000000..1f73da34e91 --- /dev/null +++ b/build/gource/getavatars.pl @@ -0,0 +1,49 @@ +#!/usr/bin/perl +#fetch Gravatars + +use strict; +use warnings; + +use LWP::Simple; +use Digest::MD5 qw(md5_hex); + +my $size = 90; +my $output_dir = './avatars'; + +die("no .git/ directory found in current path\n") unless -d './avatars'; + +mkdir($output_dir) unless -d $output_dir; + +open(GITLOG, q/git log --pretty=format:"%ae|%an" |/) or die("failed to read git-log: $!\n"); + +my %processed_authors; + +while() { + chomp; + my($email, $author) = split(/\|/, $_); + + next if $processed_authors{$author}++; + + my $author_image_file = $output_dir . '/' . $author . '.png'; + + #skip images we have + next if -e $author_image_file; + + #try and fetch image + + my $grav_url = "http://www.gravatar.com/avatar/".md5_hex(lc $email)."?d=404&size=".$size; + + warn "fetching image for '$author' $email ($grav_url)...\n"; + + my $rc = getstore($grav_url, $author_image_file); + + sleep(1); + + if($rc != 200) { + unlink($author_image_file); + next; + } +} + +close GITLOG; + diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php index ea04cb82b0a..ddf3b4cf2db 100644 --- a/htdocs/accountancy/closure/index.php +++ b/htdocs/accountancy/closure/index.php @@ -75,7 +75,7 @@ $textnextyear = ' trans("DescClosure") . '
'; +print ''.$langs->trans("DescClosure") . '
'; print '
'; @@ -111,8 +111,7 @@ $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - while ( $row = $db->fetch_row($resql)) { - + while ($row = $db->fetch_row($resql)) { print ''; for($i = 1; $i <= 12; $i ++) { print '' . $row[$i] . ''; @@ -120,6 +119,7 @@ if ($resql) { print '' . $row[13] . ''; print ''; } + $db->free($resql); } else { print $db->lasterror(); // Show last sql error diff --git a/htdocs/accountancy/closure/validate.php b/htdocs/accountancy/closure/validate.php index 748da9fe24d..26b53009fcc 100644 --- a/htdocs/accountancy/closure/validate.php +++ b/htdocs/accountancy/closure/validate.php @@ -133,8 +133,7 @@ $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - while ( $row = $db->fetch_row($resql)) { - + while ($row = $db->fetch_row($resql)) { for($i = 1; $i <= 12; $i ++) { print '' . $row[$i] . '

'; print ''; @@ -142,7 +141,7 @@ if ($resql) { } print '' . $row[13] . ''; } - print + $db->free($resql); } else { print $db->lasterror(); // Show last sql error diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 84560d5a533..07ae81e2994 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -100,9 +100,9 @@ class BOM extends CommonObject 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>300, 'notnull'=>1,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>1,), 'date_valid' => array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>502, 'notnull'=>0,), - 'fk_user_creat' => array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'llx_user.rowid',), - 'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1,), - 'fk_user_valid' => array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>512, 'notnull'=>0,), + 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid',), + 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1,), + 'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>512, 'notnull'=>0,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900, 'notnull'=>-1,), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'notnull'=>1, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Enabled', 9=>'Disabled')), ); diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 59da2cde8ae..1f83308f1d7 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -101,11 +101,11 @@ class MyObject extends CommonObject 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>500), 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 0, 'position'=>501), //'date_validation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502), - 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>510, 'foreignkey'=>'user.rowid'), - 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511), - //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), + 'fk_user_creat' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>510, 'foreignkey'=>'user.rowid'), + 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511), + //'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), - 'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=> 1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', 9=>'Canceled')), + 'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=> 1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 9=>'Canceled')), ); /**