diff --git a/ChangeLog b/ChangeLog index 63952957652..bddd25d5dd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.3 compared to 3.2 ***** For users: +- New: If field "signature" is filled into user table, text is added + at end of predefined email texts. If option MAIL_DO_NOT_USE_SIGN is on, this + feautre is disabled. - New: Add link "Back to list" on all cards. - New: After first install, warning are visible onto mandatory setup not configured. Show also total number of activated modules. @@ -42,7 +45,8 @@ For developers: - New: Can add a link on title field of added dictionnary. - New: Uniformize code. - New: Add option WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER and - WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER + WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER. +- New: A module can add several css and js. - New: removed deprecated methods ldap::connect, formadmin::select_lang, html::select_tva diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 6951bc28bb4..bff952cd317 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -324,7 +324,6 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/theme/amarok`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/lightbox`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`; diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 98e50bc813a..71401511e7a 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -73,16 +73,17 @@ class modMyModule extends DolibarrModules // for specific path of parts (eg: /mymodule/core/modules/barcode) // for specific css file (eg: /mymodule/css/mymodule.css.php) //$this->module_parts = array( - // 'triggers' => 0, // Set this to 1 if module has its own trigger directory (core/triggers) - // 'login' => 0, // Set this to 1 if module has its own login method directory (core/login) - // 'substitutions' => 0, // Set this to 1 if module has its own substitution function file (core/substitutions) - // 'menus' => 0, // Set this to 1 if module has its own menus handler directory (core/menus) - // 'theme' => 0, // Set this to 1 if module has its own theme directory (core/theme) - // 'tpl' => 0, // Set this to 1 if module overwrite template dir (core/tpl) - // 'barcode' => 0, // Set this to 1 if module has its own barcode directory (core/modules/barcode) - // 'models' => 0, // Set this to 1 if module has its own models directory (core/modules/xxx) - // 'css' => '/mymodule/css/mymodule.css.php', // Set this to relative path of css if module has its own css file - // 'hooks' => array('hookcontext1','hookcontext2') // Set here all hooks context managed by module + // 'triggers' => 0, // Set this to 1 if module has its own trigger directory (core/triggers) + // 'login' => 0, // Set this to 1 if module has its own login method directory (core/login) + // 'substitutions' => 0, // Set this to 1 if module has its own substitution function file (core/substitutions) + // 'menus' => 0, // Set this to 1 if module has its own menus handler directory (core/menus) + // 'theme' => 0, // Set this to 1 if module has its own theme directory (core/theme) + // 'tpl' => 0, // Set this to 1 if module overwrite template dir (core/tpl) + // 'barcode' => 0, // Set this to 1 if module has its own barcode directory (core/modules/barcode) + // 'models' => 0, // Set this to 1 if module has its own models directory (core/modules/xxx) + // 'css' => array('/mymodule/css/mymodule.css.php'), // Set this to relative path of css file if module has its own css file + // 'js' => array('/mymodule/js/mymodule.js'), // Set this to relative path of js file if module must load a js on all pages + // 'hooks' => array('hookcontext1','hookcontext2') // Set here all hooks context managed by module // 'workflow' => array('WORKFLOW_MODULE1_YOURACTIONTYPE_MODULE2'=>array('enabled'=>'! empty($conf->module1->enabled) && ! empty($conf->module2->enabled)', 'picto'=>'yourpicto@mymodule')) // Set here all workflow context managed by module // ); $this->module_parts = array(); diff --git a/htdocs/admin/fournisseur.php b/htdocs/admin/fournisseur.php index efc3b826b2a..4c6c3fa533d 100644 --- a/htdocs/admin/fournisseur.php +++ b/htdocs/admin/fournisseur.php @@ -55,7 +55,7 @@ if ($action == 'updateMask') { $maskconstorder=GETPOST('maskconstorder','alpha'); $maskorder=GETPOST('maskorder','alpha'); - + if ($maskconstorder) $res = dolibarr_set_const($db,$maskconstorder,$maskorder,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; @@ -77,7 +77,7 @@ if ($action == 'specimen') // For orders $commande = new CommandeFournisseur($db); $commande->initAsSpecimen(); $commande->thirdparty=$specimenthirdparty; - + // Search template files $file=''; $classname=''; $filefound=0; $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); @@ -91,13 +91,13 @@ if ($action == 'specimen') // For orders break; } } - + if ($filefound) { require_once($file); - - $module = new $classname($db); - + + $module = new $classname($db,$commande); + if ($module->write_file($commande,$langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande_fournisseur&file=SPECIMEN.pdf"); @@ -123,7 +123,7 @@ if ($action == 'specimenfacture') // For invoices $facture = new FactureFournisseur($db); $facture->initAsSpecimen(); $facture->thirdparty=$specimenthirdparty; // Define who should has build the invoice (so the supplier) - + // Search template files $file=''; $classname=''; $filefound=0; $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); @@ -137,13 +137,13 @@ if ($action == 'specimenfacture') // For invoices break; } } - + if ($filefound) { require_once($file); - - $module = new $classname($db); - + + $module = new $classname($db,$facture); + if ($module->write_file($facture,$langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=SPECIMEN.pdf"); @@ -166,7 +166,7 @@ if ($action == 'set') { $label = GETPOST('label','alpha'); $scandir = GETPOST('scandir','alpha'); - + $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", "; $sql.= ($label?"'".$db->escape($label)."'":'null').", "; @@ -198,7 +198,7 @@ if ($action == 'setdoc') { $label = GETPOST('label','alpha'); $scandir = GETPOST('scandir','alpha'); - + $db->begin(); if ($type == 'order_supplier' && dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) diff --git a/htdocs/admin/project.php b/htdocs/admin/project.php index ad67ba3a317..80be64c8153 100644 --- a/htdocs/admin/project.php +++ b/htdocs/admin/project.php @@ -51,7 +51,7 @@ if ($action == 'updateMask') { $maskconstproject=GETPOST('maskconstproject','alpha'); $maskproject=GETPOST('maskproject','alpha'); - + if ($maskconstproject) $res = dolibarr_set_const($db,$maskconstproject,$maskproject,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; @@ -86,7 +86,7 @@ if ($action == 'specimen') break; } } - + if ($filefound) { require_once($file); @@ -207,7 +207,7 @@ foreach ($dirmodels as $reldir) if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; if ($module->isEnabled()) - { + { $var=!$var; print ''.$module->nom."\n"; print $module->info(); @@ -339,10 +339,10 @@ foreach ($dirmodels as $reldir) // Active if (in_array($name, $def)) { - print "\n"; + print "\n"; print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"),'switch_on'); - print ''; + print ''; print ""; } else @@ -371,7 +371,7 @@ foreach ($dirmodels as $reldir) $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); print ''; - $link=''.img_object($langs->trans("Preview"),'order').''; + $link=''.img_object($langs->trans("Preview"),'project').''; print $form->textwithpicto('     '.$link,$htmltooltip,-1,0); print ''; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 76cdd822ce5..11ce0f53b4b 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -280,7 +280,7 @@ class Commande extends CommonOrder dol_syslog("Rename ok"); // Suppression ancien fichier PDF dans nouveau rep - dol_delete_file($conf->commande->dir_output.'/'.$snum.'/'.$comref.'.*'); + dol_delete_file($conf->commande->dir_output.'/'.$snum.'/'.$comref.'*.*'); } } } diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index 5efeaad7b04..9416732af77 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -98,7 +98,8 @@ $formother = new FormOther($db); $formfile = new FormFile($db); $companystatic = new Societe($db); -llxHeader(); +$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes"; +llxHeader('',$langs->trans("Orders"),$help_url); $sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,'; $sql.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as facturee'; diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index cae2461a780..b99b92391a9 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -29,10 +29,12 @@ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); -require_once(DOL_DOCUMENT_ROOT ."/commande/class/commande.class.php"); +require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); +require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/report.lib.php"); +if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT."/core/lib/project.lib.php"); $langs->load('orders'); $langs->load('deliveries'); @@ -73,10 +75,9 @@ if ($action == 'create') } } $now=dol_now(); -$html = new Form($db); -$formfile = new FormFile($db); -$companystatic = new Societe($db); -$htmlother = new FormOther($db); + +$viewstatut=GETPOST('viewstatut'); + /* * Actions @@ -267,30 +268,30 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) { $fk_parent_line = 0; } - $result = $object->addline( - $id, - $desc, - $lines[$i]->subprice, - $lines[$i]->qty, - $lines[$i]->tva_tx, - $lines[$i]->localtax1_tx, - $lines[$i]->localtax2_tx, - $lines[$i]->fk_product, - $lines[$i]->remise_percent, - $date_start, - $date_end, - 0, - $lines[$i]->info_bits, - $lines[$i]->fk_remise_except, - 'HT', - 0, - $product_type, - $lines[$i]->rang, - $lines[$i]->special_code, - $object->origin, - $lines[$i]->rowid, - $fk_parent_line - ); + $result = $object->addline( + $id, + $desc, + $lines[$i]->subprice, + $lines[$i]->qty, + $lines[$i]->tva_tx, + $lines[$i]->localtax1_tx, + $lines[$i]->localtax2_tx, + $lines[$i]->fk_product, + $lines[$i]->remise_percent, + $date_start, + $date_end, + 0, + $lines[$i]->info_bits, + $lines[$i]->fk_remise_except, + 'HT', + 0, + $product_type, + $lines[$i]->rang, + $lines[$i]->special_code, + $object->origin, + $lines[$i]->rowid, + $fk_parent_line + ); if ($result > 0) { $lineid=$result; @@ -342,146 +343,149 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) $mesgs[]='
'.$object->error.'
'; } } +} - /* - * View - */ - $html = new Form($db); - $htmlother = new FormOther($db); - $formfile = new FormFile($db); - $now=dol_now(); - // Mode creation - if ($action == 'create') +/* + * View + */ + +$html = new Form($db); +$htmlother = new FormOther($db); +$formfile = new FormFile($db); +$companystatic = new Societe($db); + +// Mode creation +if ($action == 'create') +{ + $facturestatic=new Facture($db); + + llxHeader(); + print_fiche_titre($langs->trans('NewBill')); + + $soc = new Societe($db); + if ($socid) $res=$soc->fetch($socid); + if ($res) { - $facturestatic=new Facture($db); + $cond_reglement_id = $soc->cond_reglement_id; + $mode_reglement_id = $soc->mode_reglement_id; + $remise_percent = $soc->remise_percent; + } + $remise_absolue = 0; + $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; - llxHeader(); - print_fiche_titre($langs->trans('NewBill')); + $absolute_discount=$soc->getAvailableDiscounts(); + print '
'; + print ''; + print ''; + print '' ."\n"; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + // Ref + print ''; + // Tiers + print ''; + print ''."\n"; + print ''; + // Payment term + print ''; + // Payment mode + print ''; + // Project + if ($conf->projet->enabled) + { + $langs->load('projects'); + print ''; + } + // Modele PDF + print ''; + print '"; - $soc = new Societe($db); - if ($socid) $res=$soc->fetch($socid); - if ($res) + // Public note + print ''; + print ''; + print ''; + // Private note + if (! $user->societe_id) + { print ''; - print ''; + print ''; print ''; - // Private note - if (! $user->societe_id) - { - print ''; - print ''; - print ''; - } - - print '
'.$langs->trans('Ref').''.$langs->trans('Draft').'
'.$langs->trans('Customer').''; + print $soc->getNomUrl(1); + print ''; + print '
'.$langs->trans('Type').''; + print ''."\n"; + // Standard invoice + print ''."\n"; + print '
'; + print ''; + print ''; + $desc=$html->textwithpicto($langs->trans("InvoiceStandardAsk"),$langs->transnoentities("InvoiceStandardDesc"),1); + print $desc; + print '
'; + // Date invoice + print '
'.$langs->trans('Date').''; + $html->select_date(0,'','','','',"add",1,1); + print '
'.$langs->trans('PaymentConditionsShort').''; + $html->select_conditions_paiements(isset($_POST['cond_reglement_id'])?$_POST['cond_reglement_id']:$cond_reglement_id,'cond_reglement_id'); + print '
'.$langs->trans('PaymentMode').''; + $html->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id,'mode_reglement_id'); + print '
'.$langs->trans('Project').''; + select_projects($soc->id, $projectid, 'projectid'); + print '
'.$langs->trans('Model').''; + include_once(DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'); + $liste=ModelePDFFactures::liste_modeles($db); + print $html->selectarray('model',$liste,$conf->global->FACTURE_ADDON_PDF); + print "
'.$langs->trans('NotePublic').''; + print '
'.$langs->trans('NotePublic').''.$langs->trans('NotePrivate').''; - print '
'.$langs->trans('NotePrivate').''; - print '
'; - print ''; - } + print ''; + print ''; + + while ($i < $n) { print ''; - + $i++; } - + print "\n"; // Button "Create Draft" print '
'; print "
\n"; } + //Mode liste -else +if (($action != 'create' && $action != 'add') || ! empty($mesgs)) { llxHeader(); ?> - rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ' WHERE c.fk_soc = s.rowid'; - $sql.= ' AND c.fk_statut in (1, 2) AND c.facture = 0'; + // Which invoice to show + if ($viewstatut <> '') + { + if ($viewstatut < 4 && $viewstatut > -2) + { + $sql.= ' AND c.fk_statut ='.$viewstatut; // brouillon, validee, en cours, annulee + if ($viewstatut == 3) + { + $sql.= ' AND c.facture = 0'; // need to create invoice + } + } + if ($viewstatut == 4) + { + $sql.= ' AND c.facture = 1'; // invoice created + } + if ($viewstatut == -2) // To process + { + //$sql.= ' AND c.fk_statut IN (1,2,3) AND c.facture = 0'; + $sql.= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected + } + } $sql.= ' AND s.entity = '.$conf->entity; if ($socid) $sql.= ' AND s.rowid = '.$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; @@ -511,18 +535,18 @@ else { $sql.= " AND (c.ref LIKE '%".$db->escape($sall)."%' OR c.note LIKE '%".$db->escape($sall)."%')"; } - + //Date filter if ($date_start && $date_end) $sql.= " AND c.date_commande >= '".$db->idate($date_start)."' AND c.date_commande <= '".$db->idate($date_end)."'"; if ($date_starty && $date_endy) $sql.= " AND c.date_livraison >= '".$db->idate($date_starty)."' AND c.date_livraison <= '".$db->idate($date_endy)."'"; - + if (!empty($sref_client)) { $sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\''; } $sql.= ' ORDER BY '.$sortfield.' '.$sortorder; $resql = $db->query($sql); - + if ($resql) { if ($socid) @@ -545,7 +569,7 @@ else print '

'; $companystatic->id=$socid; $companystatic->nom=$soc->nom; - + print $companystatic->getNomUrl(1,'customer'); print '

'; print ''; @@ -557,7 +581,7 @@ else print_liste_field_titre($langs->trans('Status'),'','','','','align="right"'); print_liste_field_titre($langs->trans('GenerateBill'),'','','','','align="center"'); print ''; - + // Lignes des champs de filtre print ''; print ''; @@ -569,52 +593,52 @@ else //print ''; - + print ''; + //DATE DELIVERY print ''; - - //SEARCH BUTTON + + //SEARCH BUTTON print ''; - + print ''; print ''; - + print ''; $var=True; $generic_commande = new Commande($db); - + while ($i < $num) { $objp = $db->fetch_object($resql); $var=!$var; print ''; print ''; - + print ''; - + // Order date print ''; - + //Delivery date print ''; - + // Statut print ''; - + // Checkbox print '' ; - + print ''; - + $total = $total + $objp->price; $subtotal = $subtotal + $objp->price; $i++; } print '
'; print ''; print ''; - + //DATE ORDER print ''; print $period; - print ''; print $periodely; print ''; print ''; - + //ALL/NONE print ''; if ($conf->use_javascript_ajax) print ''.$langs->trans("All").' / '.$langs->trans("None").''; print '
'; - + $generic_commande->id=$objp->rowid; $generic_commande->ref=$objp->ref; - + print ''; print ''; - + print ''; - + print '
'; print $generic_commande->getNomUrl(1,$objp->fk_statut); print ''; if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && $db->jdate($objp->date_valid) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning"); print ''; $filename=dol_sanitizeFileName($objp->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref); @@ -622,37 +646,37 @@ else $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); print '
'; print '
'.$objp->ref_client.''; print dol_print_date($db->jdate($objp->date_commande),'day'); print ''; print dol_print_date($db->jdate($objp->date_livraison),'day'); print ''.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).''; print ''; print '
'; - + /* - * Boutons actions + * Boutons actions */ print '
'; print ''; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index a8e10747977..87405b5e0be 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1724,7 +1724,7 @@ class Facture extends CommonInvoice dol_syslog("Rename ok"); // Suppression ancien fichier PDF dans nouveau rep - dol_delete_file($conf->facture->dir_output.'/'.$snumfa.'/'.$facref.'.*'); + dol_delete_file($conf->facture->dir_output.'/'.$snumfa.'/'.$facref.'*.*'); } } } diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 494867ec94f..cd474a141bf 100755 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -165,6 +165,24 @@ abstract class CommonDocGenerator ); } + /** + * Rect pdf + * + * @param unknown_type $pdf + * @param unknown_type $x + * @param unknown_type $y + * @param unknown_type $l + * @param unknown_type $h + * @param int $hidetop Hide top + * @param int $hidebottom Hide bottom + */ + function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0) + { + if (empty($hidetop)) $pdf->line($x, $y, $x+$l, $y); + $pdf->line($x+$l, $y, $x+$l, $y+$h); + if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h); + $pdf->line($x, $y+$h, $x, $y); + } } ?> diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 78255aa9084..c3c64758225 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -52,7 +52,7 @@ class Conf public $smart_menu; public $modules = array(); // List of activated modules - public $modules_parts = array('js'=>array(),'triggers'=>array(),'login'=>array(),'substitutions'=>array(),'menus'=>array(),'theme'=>array(),'tpl'=>array(),'barcode'=>array(),'models'=>array(),'hooks'=>array()); // List of modules parts + public $modules_parts = array('css'=>array(), 'js'=>array(),'triggers'=>array(),'login'=>array(),'substitutions'=>array(),'menus'=>array(),'theme'=>array(),'tpl'=>array(),'barcode'=>array(),'models'=>array(),'hooks'=>array()); // List of modules parts // TODO Remove thoose arrays with generic module_parts public $tabs_modules = array(); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 29433cfb63b..19f5e7de09b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1424,7 +1424,7 @@ class Form $outval=''; $opt = '
');var arrPageSizes=___getPageSize();$('#jquery-overlay').css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').click(function(){_finish();});$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function(){_finish();return false;});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#jquery-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});});} -function _set_image_to_view(){$('#lightbox-loading').show();if(settings.fixedNavigation){$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}else{$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();} -var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);objImagePreloader.onload=function(){};};objImagePreloader.src=settings.imageArray[settings.activeImage][0];};function _resize_container_image_box(intImageWidth,intImageHeight){var intCurrentWidth=$('#lightbox-container-image-box').width();var intCurrentHeight=$('#lightbox-container-image-box').height();var intWidth=(intImageWidth+(settings.containerBorderSize*2));var intHeight=(intImageHeight+(settings.containerBorderSize*2));var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;$('#lightbox-container-image-box').animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image();});if((intDiffW==0)&&(intDiffH==0)){if($.browser.msie){___pause(250);}else{___pause(100);}} -$('#lightbox-container-image-data-box').css({width:intImageWidth});$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.containerBorderSize*2)});};function _show_image(){$('#lightbox-loading').hide();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation();});_preload_neighbor_images();};function _show_image_data(){$('#lightbox-container-image-data-box').slideDown('fast');$('#lightbox-image-details-caption').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();} -if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+settings.imageArray.length).show();}} -function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.imageBlank+') no-repeat'});if(settings.activeImage!=0){if(settings.fixedNavigation){$('#lightbox-nav-btnPrev').css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}} -if(settings.activeImage!=(settings.imageArray.length-1)){if(settings.fixedNavigation){$('#lightbox-nav-btnNext').css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}} -_enable_keyboard_navigation();} -function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent);});} -function _disable_keyboard_navigation(){$(document).unbind();} -function _keyboard_action(objEvent){if(objEvent==null){keycode=event.keyCode;escapeKey=27;}else{keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE;} -key=String.fromCharCode(keycode).toLowerCase();if((key==settings.keyToClose)||(key=='x')||(keycode==escapeKey)){_finish();} -if((key==settings.keyToPrev)||(keycode==37)){if(settings.activeImage!=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation();}} -if((key==settings.keyToNext)||(keycode==39)){if(settings.activeImage!=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation();}}} -function _preload_neighbor_images(){if((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0];} -if(settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0];}} -function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeOut(function(){$('#jquery-overlay').remove();});$('embed, object, select').css({'visibility':'visible'});} -function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;} -var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;} -windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;} -if(yScroll35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.2N.3g=6(4){4=23.2H({2B:\'#34\',2g:0.8,1d:F,1M:\'18/5-33-Y.16\',1v:\'18/5-1u-2Q.16\',1E:\'18/5-1u-2L.16\',1W:\'18/5-1u-2I.16\',19:\'18/5-2F.16\',1f:10,2A:3d,2s:\'1j\',2o:\'32\',2j:\'c\',2f:\'p\',2d:\'n\',h:[],9:0},4);f I=N;6 20(){1X(N,I);u F}6 1X(1e,I){$(\'1U, 1S, 1R\').l({\'1Q\':\'2E\'});1O();4.h.B=0;4.9=0;7(I.B==1){4.h.1J(v 1m(1e.17(\'J\'),1e.17(\'2v\')))}j{36(f i=0;i<1w g="5-b"><1w W="\'+4.1M+\'"><1i g="5-b-A-1t"><1i g="5-b-A-1g"><1w W="\'+4.1W+\'">\');f z=1D();$(\'#q-13\').l({2K:4.2B,2J:4.2g,S:z[0],P:z[1]}).1V();f R=1p();$(\'#q-5\').l({1T:R[1]+(z[3]/10),1c:R[0]}).E();$(\'#q-13,#q-5\').C(6(){1a()});$(\'#5-Y-29,#5-1s-22\').C(6(){1a();u F});$(G).2G(6(){f z=1D();$(\'#q-13\').l({S:z[0],P:z[1]});f R=1p();$(\'#q-5\').l({1T:R[1]+(z[3]/10),1c:R[0]})})}6 D(){$(\'#5-Y\').E();7(4.1d){$(\'#5-b,#5-s-b-T-w,#5-b-A-1g\').1b()}j{$(\'#5-b,#5-k,#5-k-V,#5-k-X,#5-s-b-T-w,#5-b-A-1g\').1b()}f Q=v 1j();Q.1P=6(){$(\'#5-b\').2D(\'W\',4.h[4.9][0]);1N(Q.S,Q.P);Q.1P=6(){}};Q.W=4.h[4.9][0]};6 1N(1o,1r){f 1L=$(\'#5-s-b-w\').S();f 1K=$(\'#5-s-b-w\').P();f 1n=(1o+(4.1f*2));f 1y=(1r+(4.1f*2));f 1I=1L-1n;f 2z=1K-1y;$(\'#5-s-b-w\').3f({S:1n,P:1y},4.2A,6(){2y()});7((1I==0)&&(2z==0)){7($.3e.3c){1H(3b)}j{1H(3a)}}$(\'#5-s-b-T-w\').l({S:1o});$(\'#5-k-V,#5-k-X\').l({P:1r+(4.1f*2)})};6 2y(){$(\'#5-Y\').1b();$(\'#5-b\').1V(6(){2u();2t()});2r()};6 2u(){$(\'#5-s-b-T-w\').38(\'35\');$(\'#5-b-A-1t\').1b();7(4.h[4.9][1]){$(\'#5-b-A-1t\').2p(4.h[4.9][1]).E()}7(4.h.B>1){$(\'#5-b-A-1g\').2p(4.2s+\' \'+(4.9+1)+\' \'+4.2o+\' \'+4.h.B).E()}}6 2t(){$(\'#5-k\').E();$(\'#5-k-V,#5-k-X\').l({\'K\':\'1C M(\'+4.19+\') L-O\'});7(4.9!=0){7(4.1d){$(\'#5-k-V\').l({\'K\':\'M(\'+4.1v+\') 1c 15% L-O\'}).11().1k(\'C\',6(){4.9=4.9-1;D();u F})}j{$(\'#5-k-V\').11().2m(6(){$(N).l({\'K\':\'M(\'+4.1v+\') 1c 15% L-O\'})},6(){$(N).l({\'K\':\'1C M(\'+4.19+\') L-O\'})}).E().1k(\'C\',6(){4.9=4.9-1;D();u F})}}7(4.9!=(4.h.B-1)){7(4.1d){$(\'#5-k-X\').l({\'K\':\'M(\'+4.1E+\') 2l 15% L-O\'}).11().1k(\'C\',6(){4.9=4.9+1;D();u F})}j{$(\'#5-k-X\').11().2m(6(){$(N).l({\'K\':\'M(\'+4.1E+\') 2l 15% L-O\'})},6(){$(N).l({\'K\':\'1C M(\'+4.19+\') L-O\'})}).E().1k(\'C\',6(){4.9=4.9+1;D();u F})}}2k()}6 2k(){$(d).30(6(12){2i(12)})}6 1G(){$(d).11()}6 2i(12){7(12==2h){U=2Z.2e;1x=27}j{U=12.2e;1x=12.2Y}14=2X.2W(U).2U();7((14==4.2j)||(14==\'x\')||(U==1x)){1a()}7((14==4.2f)||(U==37)){7(4.9!=0){4.9=4.9-1;D();1G()}}7((14==4.2d)||(U==39)){7(4.9!=(4.h.B-1)){4.9=4.9+1;D();1G()}}}6 2r(){7((4.h.B-1)>4.9){2c=v 1j();2c.W=4.h[4.9+1][0]}7(4.9>0){2b=v 1j();2b.W=4.h[4.9-1][0]}}6 1a(){$(\'#q-5\').2a();$(\'#q-13\').2T(6(){$(\'#q-13\').2a()});$(\'1U, 1S, 1R\').l({\'1Q\':\'2S\'})}6 1D(){f o,r;7(G.1h&&G.28){o=G.26+G.2R;r=G.1h+G.28}j 7(d.m.25>d.m.24){o=d.m.2P;r=d.m.25}j{o=d.m.2O;r=d.m.24}f y,H;7(Z.1h){7(d.t.1l){y=d.t.1l}j{y=Z.26}H=Z.1h}j 7(d.t&&d.t.1A){y=d.t.1l;H=d.t.1A}j 7(d.m){y=d.m.1l;H=d.m.1A}7(r'."\n"; // JQuery print ''."\n"; // Tooltip print ''."\n"; // JNotify - //print ''."\n"; // Lightbox if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD)) // jQuery fileupload { print ''."\n"; @@ -903,17 +902,22 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache='.$_SESSION['dol_resetcache']; //print 'themepath='.$themepath.' themeparam='.$themeparam;exit; print ''."\n"; + // CSS forced by modules (relative url starting with /) if (isset($conf->modules_parts['css'])) { - $dircss=(array) $conf->modules_parts['css']; - foreach($dircss as $key => $cssfile) + $arraycss=(array) $conf->modules_parts['css']; + foreach($arraycss as $modcss => $filescss) { - // cssfile is a relative path - print ''."\n"; + $filescss=(array) $filescss; // To be sure filecss is an array + foreach($filescss as $cssfile) + { + // cssfile is a relative path + print ''."\n"; + } } } // CSS forced by page in top_htmlhead call (relative url starting with /) @@ -948,7 +952,6 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs else print ''."\n"; print ''."\n"; print ''."\n"; - //print ''."\n"; // jQuery Layout if (! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) || defined('REQUIRE_JQUERY_LAYOUT')) { @@ -1044,12 +1047,19 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print ''."\n"; // JS forced by modules (relative url starting with /) - $dirjs=(array) $conf->modules_parts['js']; - foreach($dirjs as $key => $jsfile) - { - // jsfile is a relative path - print ''."\n"; - } + if (isset($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2')) + { + $arrayjs=(array) $conf->modules_parts['js']; + foreach($arrayjs as $modjs => $filesjs) + { + $filesjs=(array) $filesjs; // To be sure filejs is an array + foreach($filesjs as $jsfile) + { + // jsfile is a relative path + print ''."\n"; + } + } + } // JS forced by page in top_htmlhead (relative url starting with /) if (is_array($arrayofjs)) { diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php index 617e477c0fd..37b48c7be00 100755 --- a/htdocs/product/canvas/product/actions_card_product.class.php +++ b/htdocs/product/canvas/product/actions_card_product.class.php @@ -106,7 +106,7 @@ class ActionsCardProduct $this->tpl['description'] = nl2br($this->description); // Statut - $this->tpl['status'] = $this->getLibStatut(2); + $this->tpl['status'] = $this->object->getLibStatut(2); // Note $this->tpl['note'] = nl2br($this->note); diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index d665e175c27..3e27cd968dc 100755 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -105,7 +105,7 @@ class ActionsCardService $this->tpl['description'] = nl2br($this->description); // Statut - $this->tpl['status'] = $this->getLibStatut(2); + $this->tpl['status'] = $this->object->getLibStatut(2); // Note $this->tpl['note'] = nl2br($this->note); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index aff8a64e7fc..cc671d254d0 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2593,23 +2593,6 @@ class Product extends CommonObject $pdirthumb = $pdir.'thumbs/'; $return =''."\n"; - /*$return.="\n"; - */ $nbphoto=0; $dir_osencoded=dol_osencode($dir); @@ -2647,7 +2630,7 @@ class Product extends CommonObject if ($nbbyrow) $return.= ''; $return.= "\n"; - $return.= ''; + $return.= ''; // Show image (width height=$maxHeight) // Si fichier vignette disponible et image source trop grande, on utilise la vignette, sinon on utilise photo origine diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 2e0d8b66984..68d2ced3d7e 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -170,6 +170,7 @@ if (! empty($project_ref) && ! empty($withproject)) llxHeader("",$langs->trans("Task")); $form = new Form($db); +$userstatic = new User($db); if ($id > 0 || ! empty($ref)) { @@ -403,17 +404,17 @@ if ($id > 0 || ! empty($ref)) print ''; // User - $user->id = $task_time->fk_user; print ''; if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) { - print $form->select_users($user->id,'userid_line'); + print $form->select_users($task_time->fk_user,'userid_line'); } else { - $user->nom = $task_time->name; - $user->prenom = $task_time->firstname; - print $user->getNomUrl(1); + $userstatic->id = $task_time->fk_user; + $userstatic->nom = $task_time->name; + $userstatic->prenom = $task_time->firstname; + print $userstatic->getNomUrl(1); } print '';