From cb9e0983dd1ebf11625472c846fdadc995301bcc Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Sun, 6 Jul 2014 10:24:01 +0200 Subject: [PATCH 1/6] Remove fetch_optionnal becauwe done in fetch from product class --- htdocs/product/fiche.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index deeae6784e6..07830cd793c 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -1014,8 +1014,6 @@ else else if ($object->id > 0) { - $res=$object->fetch_optionals($object->id,$extralabels); - // Fiche en mode edition if ($action == 'edit' && ($user->rights->produit->creer || $user->rights->service->creer)) { From 4d9f78dc07d8df31d3ab58897cc1b7fdb8f4c9b8 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 6 Jul 2014 15:06:34 +0200 Subject: [PATCH 2/6] getlibstatut added Add function getlibstatut and libstatut on task (fk_statut allready present on project_task table) --- htdocs/projet/class/task.class.php | 79 ++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 93fd2ac6b6d..d9f8357a751 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1218,5 +1218,84 @@ class Task extends CommonObject } } + + /** + * \brief Return status label of object + * \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * \return string Label + */ + function getLibStatut($mode=0) + { + return $this->LibStatut($this->fk_statut,$mode); + } + + /** + * \brief Renvoi status label for a status + * \param statut id statut + * \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * \return string Label + */ + function LibStatut($statut,$mode=0) + { + // list of Statut of the task + $this->statuts[0]='Draft'; + $this->statuts[1]='Validated'; + $this->statuts[2]='Running'; + $this->statuts[3]='Finish'; + $this->statuts[4]='Transfered'; + $this->statuts_short[0]='Draft'; + $this->statuts_short[1]='Validated'; + $this->statuts_short[2]='Running'; + $this->statuts_short[3]='Finish'; + $this->statuts_short[4]='Transfered'; + + global $langs; + + if ($mode == 0) + { + return $langs->trans($this->statuts[$statut]); + } + if ($mode == 1) + { + return $langs->trans($this->statuts_short[$statut]); + } + if ($mode == 2) + { + if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]); + if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts_short[$statut]); + if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts_short[$statut]); + if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]); + if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]); + if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts_short[$statut]); + } + if ($mode == 3) + { + if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); + if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); + if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); + if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); + if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); + } + if ($mode == 4) + { + if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); + if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]); + if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]); + if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]); + if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); + if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]); + } + if ($mode == 5) + { + if ($statut==0) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); + if ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); + if ($statut==2) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); + if ($statut==3) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); + if ($statut==4) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + if ($statut==5) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); + } + } + } ?> From 56c067f15c5e70eabbf34a63007b4036e0a461bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Jul 2014 21:16:27 +0200 Subject: [PATCH 3/6] Fix: form is not allowed inside a table Conflicts: htdocs/fichinter/fiche.php --- htdocs/fichinter/fiche.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 551aa7b94a5..fcd03755136 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -50,6 +50,7 @@ if (! empty($conf->global->FICHEINTER_ADDON) && is_readable(DOL_DOCUMENT_ROOT ." require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +$langs->load("bills"); $langs->load("companies"); $langs->load("interventions"); @@ -1143,6 +1144,13 @@ else if ($id > 0 || ! empty($ref)) } + print '
'; + print ''; + if ($action == 'edit_extras') print ''; + if ($action == 'contrat') print ''; + + print ''; + print ''; $linkback = ''.$langs->trans("BackToList").''; @@ -1218,9 +1226,6 @@ else if ($id > 0 || ! empty($ref)) print '
'; if ($action == 'contrat') { - print ''; - print ''; - print ''; print ''; print ''; print ''; - print '
'; $htmlcontract= new Formcontract($db); @@ -1229,7 +1234,7 @@ else if ($id > 0 || ! empty($ref)) print '
'; + print '
'; } else { @@ -1280,16 +1285,11 @@ else if ($id > 0 || ! empty($ref)) } if ($action == 'edit_extras' && $user->rights->ficheinter->creer && GETPOST('attribute') == $key) { - print '
'; - print ''; print ''; - print ''; - print ''; print $extrafields->showInputField($key,$value); print ''; - print '
'; } else { @@ -1302,6 +1302,7 @@ else if ($id > 0 || ! empty($ref)) } print "
"; + print ''; if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) { From 96ec3ad7f4b0e5ddbc457a3720df97773ef75b6f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Jul 2014 00:14:24 +0200 Subject: [PATCH 4/6] Fix: Allow percent to solve presentation pb by some pages. --- htdocs/core/class/doleditor.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index d02f26e57a4..23fb8193fb9 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -60,7 +60,7 @@ class DolEditor * @param int $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content. * @param int $okforextendededitor True=Allow usage of extended editor tool (like fckeditor) * @param int $rows Size of rows for textarea tool - * @param int $cols Size of cols for textarea tool + * @param int $cols Size of cols for textarea tool (textarea number of cols or %) * @param int $readonly 0=Read/Edit, 1=Read only */ function __construct($htmlname,$content,$width='',$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false,$uselocalbrowser=true,$okforextendededitor=true,$rows=0,$cols=0,$readonly=0) @@ -129,7 +129,7 @@ class DolEditor $this->toolbarname = $shorttoolbarname; $this->toolbarstartexpanded = $toolbarstartexpanded; $this->rows = max(ROWS_3,$rows); - $this->cols = max(40,$cols); + $this->cols = (preg_match('/%/',$cols)?$cols:max(40,$cols)); // If $cols is a percent, we keep it, otherwise, we take max $this->height = $height; $this->width = $width; } From e8b7d36004ca4b4a1a921710a7aa45b51062e6f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Jul 2014 00:50:05 +0200 Subject: [PATCH 5/6] Fix: Solve timeout pb. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2366201ce2e..1bfa8ba53d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -97,9 +97,9 @@ script: # - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/AllTests.php # - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/BuildDocTest.php # - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/WebservicesOtherTest.php -# - phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ htdocs/core/class/dolgraph.class.php - - phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ . -# - phpcs -p --warning-severity=0 -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ . +# - phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ htdocs/core/class/dolgraph.class.php 2>&1 + - phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ . 2>&1 +# - phpcs -p --warning-severity=0 -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ . 2>&1 - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php after_script: From 6c8c23203632ddde0620c73b99f433dd069e9532 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Jul 2014 00:53:15 +0200 Subject: [PATCH 6/6] Fix: Solve timeout pb. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 26d4c64fef2..9d4c658018d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -87,9 +87,9 @@ script: # - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/AllTests.php # - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/BuildDocTest.php # - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/WebservicesOtherTest.php -# - phpcs --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ htdocs/core/class/dolgraph.class.php - - phpcs --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ . -# - phpcs --warning-severity=0 -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ . +# - phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ htdocs/core/class/dolgraph.class.php 2>&1 + - phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ . 2>&1 +# - phpcs -p --warning-severity=0 -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ . 2>&1 - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php after_script: