diff --git a/ChangeLog b/ChangeLog index 3c057697bac..3a04104b128 100644 --- a/ChangeLog +++ b/ChangeLog @@ -39,13 +39,11 @@ For users: - New: [ task #165 ] Add import/export of multiprices. - New: Add Maghreb regions and departments. - New: A more responsive desgin for statistic box of home page. -- Qual: Implement same rule for return value of all command line scripts (0 when success, <>0 if error). - New: [ task #1005 ] Adapting to Spanish legislation bill numbering - New: [ task #1011 ] Now supplier order and invoice deal with payment terms and mode. - New: [ task #1014 ] Add option to recursivly add parent category. - New: [ task #1016 ] Can define a specific numbering for deposits. - New: [ task #918 ] Stock replenishment. -- Fix: [ bug #992 ] Proforma invoices don't have a separated numeric count. - New : Add pdf link into supplier invoice list and supplier order list. - New : Genrate auto the PDF for supplier invoice. - New : Add category into filter webservice thirdparty method getListOfThirdParties. @@ -60,16 +58,22 @@ For users: - New: Add hidden option MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS. - New: Can send an email from thirdparty card. - New: Can cancel holidays that were previously validated. -- Fix: [bug #1022] correct margin calculation for credit notes. - New: Can choose contact on event (action com) creation, and filtred by thirdparty. - New: Add hidden option MAIN_FORCE_DEFAULT_STATE_ID. - New: Add page to make mass stock movement. - New: Add field oustanding limit into thirdparty properties. +- New: Can enter a vat payment of zero. +- New: Add path to installed dir of external modules + Name and web of module provider. +- New: Add option to use a specific mask for uploaded filename +- Qual: Implement same rule for return value of all command line scripts (0 when success, <>0 if error). +- Fix: [ bug #992 ] Proforma invoices don't have a separated numeric count. +- Fix: [ bug #1022 ] correct margin calculation for credit notes. +- Fix: Better management of using ajax for upload form (to solve problem when enabling ajax jquery multifile upload in some cases). For translators: - Qual: Normalized sort order of all languages files with english reference files. -- New: Add language code files for South Africa, France new caledonia. -- New: Translate the email to change password. +- New: Add language code files for South Africa, France new caledonia, Vietnam. +- New: Translate string for email to change password. For developers: - New: DolGraph can build graph with three lines. @@ -85,7 +89,6 @@ For developers: MAIN_MOTD_SETUPPAGE, MAIN_MOTD_SETUPPAGE, MAIN_HOME now accept "|langfile" into translation key to use a specific language file. - New: Make some changes to allow usage of several alternative $dolibarr_main_url_root variables. - Fix also several bugs with old code. - Qual: All nowrap properties are now using CSS class nowrap. - Qual: Move hardcoded code of module mailmanspip into trigger. - New: Into POST forms, if you can add a parameter DOL_AUTOSET_COOKIE with a vlue that is list name, @@ -96,6 +99,7 @@ For developers: - New: A trigger can return an array of error strings instead of one error string. - New: Add method to use a dictionnary as a combo box. - New: Add update method for web service product. +- Fix also several bugs with old code. WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: diff --git a/build/debian/README.howto b/build/debian/README.howto index 6f06f5ab91b..d3d74693d55 100644 --- a/build/debian/README.howto +++ b/build/debian/README.howto @@ -8,6 +8,9 @@ script to build a package, ready to be distributed, with format .DEB (for Debian, Ubuntu, ...). + +##### Prepare linux env to work + # To build a debian package, you need first # With Ubuntu 12.04 # apt-get install debhelper dpkg-source gpg lintian git-buildpackage pkg-php-tools schroot sbuild dh-linktree dh-make-php @@ -41,6 +44,9 @@ END * Ask to be included into project collab-maint: http://alioth.debian.org/projects/collab-maint/ + +##### Some interesting command to know + # To translate .po files # debconf-updatepo To run into po dir to regenate templates.pot # podebconf-report-po --from email@email.com To send email to ask translations @@ -59,6 +65,7 @@ END # dpkg-reconfigure -plow package Reconfigure package # dpkg -L packagename List content of installed package # dpkg -r packagename Remove config files and interactive saved answers +# dpkg -s packagename Give status of installed package # dpkg --purge Remove config files and interactive saved answers # # dpkg-buildpackage -us -uc Build a source and binary package @@ -66,9 +73,8 @@ END # gdebi package.deb Install a package + dependencies -########################################################## -To submit a package to Debian: +##### Global view of submit new package to Debian: - Post an ITP with reportbugs : > reportbug -B debian --email username@domain.tld wnpp @@ -90,19 +96,28 @@ http://bugs.debian.org/package -########################################################## - -To generate a package +##### Testing a package into unstable env Create a chroot called "unstable-amd64-sbuild" > sudo sbuild-createchroot --keyring= unstable /srv/chroot/unstable http://ftp.uk.debian.org/debian +Pour lister les env chroot +> schroot -l + Puis pour se connecter -> schroot +> schroot -c name_of_chroot + +Pour tester un package +> cp *.deb /srv/chroot/unstable/tmp +> sudo schroot -c name_of_chroot +> dpkg -i dolibarr*.deb +> sudo apt-get install -f -########################################################## + + +##### Create/Maintain TCPDF package To update tcpdf package: @@ -128,7 +143,7 @@ from origin/upstream and origin/pristine. Note: If there was errors solved manually, you may need to make a git commit * Add an entry into debian/changelog -> dh "My comment" will add entry. +> dch -v x.y.z-1 "My comment" will add entry. For example: dch -v x.y.z-1 "New upstream release." for a new version Warning: Date must have format reported by "date -R" @@ -157,7 +172,8 @@ http://packages.qa.debian.org/t/tcpdf.html * Package will be into release when test will be moved as stable. -########################################################## + +##### Create/Maintain dolibarr package To update dolibarr debian package @@ -183,7 +199,7 @@ from origin/upstream and origin/pristine. Note: If there was errors solved manually after get-orig-sources.sh, you may need to make a git commit * Add an entry into debian/changelog -> dh "My comment" will add entry. +> dch -v x.y.z-1 "My comment" will add entry. For example: dch -v x.y.z-1 "New upstream release." for a new version Then modify changelog to replace "unstable" with "UNRELEASED". @@ -197,6 +213,8 @@ Warning: Name and email must match value into debian/control file (Entry added h Note: You can use git-buildpackage -us -uc --git-ignore-new if you want to test build with uncommited file Note: Package is built into directory ../build-area +* Test package (see dedicated chapter to test it with debian unstable env) + * If package .deb is ok: Note: If there was errors managed manually, you may need to make a git commit but do not use option "amend" previous commit > git-buildpackage --git-tag-only --git-retag diff --git a/build/obs/README b/build/obs/README index c7dda9093f1..56589299b89 100644 --- a/build/obs/README +++ b/build/obs/README @@ -23,12 +23,13 @@ To submit a snapshot for building, we should have a service file with content www.dolibarr.org http - /files/stable/package_rpm_generic/dolibarr-3.3.2-3.src.rpm + /files/stable/package_rpm_generic/dolibarr-x.y.z-3.src.rpm -How to have such a service ? -Try to make "Add file" and select Remote URL and enter http://www.dolibarr.org/files/stable/package_rpm_generic/dolibarr-3.3.2-3.src.rpm +How to have such a service file created automatically ? +Click on "Add file", then select mode "Upload From: Remote URL" +Enter the Remote URL that should looks like this: http://www.dolibarr.org/files/stable/package_rpm_generic/dolibarr-x.y.v-3.src.rpm Then add into advanded - attributes OBS:Screenshots http://www.dolibarr.org/images/dolibarr_screenshot1.png diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 2418698e12d..609a5d27158 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -464,7 +464,11 @@ echo Restart mysql server /sbin/service mysqld restart %else %if 0%{?suse_version} +if [ -f /etc/init.d/mysqld ]; then + /etc/init.d/mysqld restart +else /sbin/service mysql restart +fi %else if [ -f /etc/init.d/mysqld ]; then /etc/init.d/mysqld restart diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index bdfb0eab0af..692114e508b 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -288,7 +288,11 @@ fi # Restart mysql echo Restart mysql -/sbin/service mysql restart +if [ -f /etc/init.d/mysqld ]; then + /etc/init.d/mysqld restart +else + /sbin/service mysql restart +fi # Show result echo diff --git a/doc/images/dolibarr_screenshot1_300x188.png b/doc/images/dolibarr_screenshot1_300x188.png new file mode 100644 index 00000000000..51c949ee67e Binary files /dev/null and b/doc/images/dolibarr_screenshot1_300x188.png differ diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index cfaa0c72004..b4e6ff2f628 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent @@ -154,22 +154,21 @@ foreach ($modulesdir as $dir) $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod))); if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) $modulequalified=0; if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0; - // We discard modules according to property disabled + // We discard modules according to property disabled if (isset($objMod->hidden) && $objMod->hidden) $modulequalified=false; - + // Define array $categ with categ with at least one qualified module if ($modulequalified) { $modules[$i] = $objMod; $filename[$i]= $modName; $orders[$i] = $objMod->family."_".$j; // Sort by family, then by module number - $special = isset($specialtostring[$objMod->special])?$specialtostring[$objMod->special]:'unknown'; + $dirmod[$i] = $dir; + // Set categ[$i] + $special = isset($specialtostring[$objMod->special])?$specialtostring[$objMod->special]:'unknown'; if ($objMod->version == 'development' || $objMod->version == 'experimental') $special='expdev'; - - //print "x".$modName." ".$orders[$i]." ".$special."\n
"; if (isset($categ[$special])) $categ[$special]++; // Array of all different modules categories else $categ[$special]=1; - $dirmod[$i] = $dir; $j++; $i++; } @@ -278,17 +277,16 @@ $var=true; if ($mode != 'marketplace') { print "\n"; - //print "\n"; + + /* print ''."\n"; - //print " \n"; print " \n"; print " \n"; print " \n"; - //print " \n"; - print " \n"; - print " \n"; + print ' '."\n"; + print ' '."\n"; print "\n"; - + */ // Show list of modules @@ -338,139 +336,151 @@ if ($mode != 'marketplace') // Print a separator if we change family //print ""; //if ($oldfamily && $family!=$oldfamily && $atleastoneforfamily) { - if ($family!=$oldfamily) { - print ''."\n '."\n"; + print '\n\n"; + print "\n"; + print ''."\n"; + print "\n"; $atleastoneforfamily=0; //print ""; } - $atleastoneforfamily++; + $atleastoneforfamily++; - if ($family!=$oldfamily) - { - $familytext=empty($familylib[$family])?$family:$familylib[$family]; - //print $familytext; - $oldfamily=$family; - } + if ($family!=$oldfamily) + { + $familytext=empty($familylib[$family])?$family:$familylib[$family]; + //print $familytext; + $oldfamily=$family; + } - $var=!$var; + $var=!$var; - //print "\n\n"; - print '\n"; + //print "\n\n"; + print '\n"; - // Picto - print ' '; + // Picto + print ' '; - // Name - print '\n"; + // Name + print '\n"; - // Desc - print "\n"; + // Desc + print '\n"; - // Version - print "\n"; + // Version + print '\n"; - // Activate/Disable and Setup (2 columns) - if (! empty($conf->global->$const_name)) - { - $disableSetup = 0; + // Activate/Disable and Setup (2 columns) + if (! empty($conf->global->$const_name)) + { + $disableSetup = 0; - print "'."\n"; - } - else - { - print ''; - print img_picto($langs->trans("Activated"),'switch_on'); - print ''."\n"; - } + if (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1))) + { + print $langs->trans("Required"); + if (! empty($conf->multicompany->enabled) && $user->entity) $disableSetup++; + print ''."\n"; + } + else + { + print ''; + print img_picto($langs->trans("Activated"),'switch_on'); + print ''."\n"; + } - if (! empty($objMod->config_page_url) && !$disableSetup) - { - if (is_array($objMod->config_page_url)) - { - print ' \n"; - } - else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs)) - { - print ''; - } - else - { - print ''; - } - } - else - { - print ""; - } + if (! empty($objMod->config_page_url) && !$disableSetup) + { + if (is_array($objMod->config_page_url)) + { + print ' \n"; + } + else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs)) + { + print ''; + } + else + { + print ''; + } + } + else + { + print ""; + } - } - else - { - print "\n \n"; - } + // Module non actif + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); + print "\n \n"; + } - print "\n"; + print "\n"; } print "
".$langs->trans("Family")."".$langs->trans("Module")."".$langs->trans("Description")."".$langs->trans("Version")."".$langs->trans("DbVersion")."".$langs->trans("Status")."".$langs->trans("SetupShort")."'.$langs->trans("Status").''.$langs->trans("SetupShort").'
xx".$oldfamily."-".$family."-".$atleastoneforfamily."
"; + if ($family!=$oldfamily) + { + print '
'; $familytext=empty($familylib[$family])?$family:$familylib[$family]; print $familytext; - print "
'.$langs->trans("SetupShort").'
yy".$oldfamily."-".$family."-".$atleastoneforfamily."
'; - $alttext=''; - //if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version); - //if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin); - if (! empty($objMod->picto)) - { - if (preg_match('/^\//i',$objMod->picto)) print img_picto($alttext,$objMod->picto,' width="14px"',1); - else print img_object($alttext,$objMod->picto,' width="14px"'); - } - else - { - print img_object($alttext,'generic'); - } - print ''; + $alttext=''; + //if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version); + //if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin); + if (! empty($objMod->picto)) + { + if (preg_match('/^\//i',$objMod->picto)) print img_picto($alttext,$objMod->picto,' width="14px"',1); + else print img_object($alttext,$objMod->picto,' width="14px"'); + } + else + { + print img_object($alttext,'generic'); + } + print ''.$objMod->getName(); - print "'.$objMod->getName(); + print ""; - print nl2br($objMod->getDesc()); - print "'; + print nl2br($objMod->getDesc()); + print ""; - print $objMod->getVersion(); - print "'; + $version=$objMod->getVersion(); + $dirofmodule=$dirmod[$key]; + if ($objMod->isCoreOrExternalModule() == 'external') + { + $text=$langs->trans("ExternalModule",$dirofmodule); + if (! empty($objMod->editor_name) && $objMod->editor_name != 'dolibarr') $text.=' - '.$objMod->editor_name; + if (! empty($objMod->editor_web) && $objMod->editor_web != 'www.dolibarr.org') $text.=' - '.$objMod->editor_web; + print $form->textwithpicto($version, $text, 1, 'help'); + } + else print $version; + print ""; + print ''; - // Module actif - if (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1))) - { - print $langs->trans("Required"); - if (! empty($conf->multicompany->enabled) && $user->entity) $disableSetup++; - print ''; - $i=0; - foreach ($objMod->config_page_url as $page) - { - $urlpage=$page; - if ($i++) - { - print ''.img_picto(ucfirst($page),"setup").' '; - // print ''.ucfirst($page).' '; - } - else - { - if (preg_match('/^([^@]+)@([^@]+)$/i',$urlpage,$regs)) - { - print ''.img_picto($langs->trans("Setup"),"setup").' '; - } - else - { - print ''.img_picto($langs->trans("Setup"),"setup").' '; - } - } - } - print "'.img_picto($langs->trans("Setup"),"setup").''.img_picto($langs->trans("Setup"),"setup").' '; + $i=0; + foreach ($objMod->config_page_url as $page) + { + $urlpage=$page; + if ($i++) + { + print ''.img_picto(ucfirst($page),"setup").' '; + // print ''.ucfirst($page).' '; + } + else + { + if (preg_match('/^([^@]+)@([^@]+)$/i',$urlpage,$regs)) + { + print ''.img_picto($langs->trans("Setup"),"setup").' '; + } + else + { + print ''.img_picto($langs->trans("Setup"),"setup").' '; + } + } + } + print "'.img_picto($langs->trans("Setup"),"setup").''.img_picto($langs->trans("Setup"),"setup").' "; + } + else + { + print ''; - if (! empty($objMod->always_enabled)) - { - // Ne devrait pas arriver. - } + if (! empty($objMod->always_enabled)) + { + // Ne devrait pas arriver. + } - // Module non actif - print ''; - print img_picto($langs->trans("Disabled"),'switch_off'); - print "  
\n"; @@ -502,7 +512,7 @@ dol_fiche_end(); // Show warning about external users -if ($mode != 'marketplace') print showModulesExludedForExternal($modules).'
'."\n"; +if ($mode != 'marketplace') print '
'.showModulesExludedForExternal($modules).'

'."\n"; llxFooter(); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 45e69448f43..834c651c2be 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -141,7 +141,7 @@ if (! $sortorder) $sortorder='DESC'; $limit = $conf->liste_limit; -$sql = 'SELECT s.rowid, s.nom, s.town, s.client, '; +$sql = 'SELECT s.rowid, s.nom, s.town, s.client, s.code_client'; $sql.= 'p.rowid as propalid, p.note_private, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,'; if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,"; $sql.= ' u.login'; @@ -368,6 +368,7 @@ if ($result) $companystatic->id=$objp->rowid; $companystatic->nom=$objp->nom; $companystatic->client=$objp->client; + $companystatic->code_client=$objp->code_client; print ''; print $companystatic->getNomUrl(1,'customer'); print ''; diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index 8f4f0045f60..6b1ebc5ac14 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -362,7 +362,7 @@ if ($resql) if (($objp->fk_statut > 0 && $objp->fk_statut < 3) || ($objp->fk_statut == 3 && $objp->facturee == 0)) { print ' '; - print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->nom, 'object_bill', 'hideonsmrtphone').''; + print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->nom, 'object_bill', 'hideonsmartphone').''; } } } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index ed174a380a4..ed7d06919ec 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1732,8 +1732,8 @@ class Facture extends CommonInvoice $sql.= " SET facnumber='".$num."', fk_statut = 1, fk_user_valid = ".$user->id.", date_valid = '".$this->db->idate($now)."'"; if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date { - $sql.= ', datef='.$this->db->idate($this->date); - $sql.= ', date_lim_reglement='.$this->db->idate($this->date_lim_reglement); + $sql.= ", datef='".$this->db->idate($this->date)."'"; + $sql.= ", date_lim_reglement='".$this->db->idate($this->date_lim_reglement)."'"; } $sql.= ' WHERE rowid = '.$this->id; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 8fe94f6c3fd..83b9fd30945 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -143,7 +143,7 @@ else $sql = 'SELECT DISTINCT'; $sql.= ' f.rowid as facid, f.facnumber, f.ref_client, f.type, f.note_private, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc,'; $sql.= ' f.datef as df, f.date_lim_reglement as datelimite,'; $sql.= ' f.paye as paye, f.fk_statut,'; -$sql.= ' s.nom, s.rowid as socid'; +$sql.= ' s.nom, s.rowid as socid, s.code_client, s.client '; if (! $sall) $sql.= ', SUM(pf.amount) as am'; // To be able to sort on status $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql.= ', '.MAIN_DB_PREFIX.'facture as f'; @@ -390,6 +390,8 @@ if ($resql) $thirdparty=new Societe($db); $thirdparty->id=$objp->socid; $thirdparty->nom=$objp->nom; + $thirdparty->client=$objp->client; + $thirdparty->code_client=$objp->code_client; print $thirdparty->getNomUrl(1,'customer'); print ''; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 34dc0262c2e..8ddfad8c3f1 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -27,10 +27,8 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; /** - \class Tva - \brief Put here description of your class - \remarks Initialy built by build_class_from_table on 2008-04-03 21:01 -*/ + * Put here description of your class + */ class Tva extends CommonObject { //public $element='tva'; //!< Id that identify managed objects @@ -51,7 +49,6 @@ class Tva extends CommonObject - /** * Constructor * @@ -115,7 +112,7 @@ class Tva extends CommonObject $sql.= ")"; - dol_syslog("Tva::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -133,16 +130,17 @@ class Tva extends CommonObject else { $this->error="Error ".$this->db->lasterror(); - dol_syslog("Tva::create ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); return -1; } } - /* - * \brief Update database - * \param user User that modify - * \param notrigger 0=no, 1=yes (no update trigger) - * \return int <0 if KO, >0 if OK + /** + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=no, 1=yes (no update trigger) + * @return int <0 if KO, >0 if OK */ function update($user=0, $notrigger=0) { @@ -177,12 +175,12 @@ class Tva extends CommonObject $sql.= " WHERE rowid=".$this->id; - dol_syslog("Tva::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $this->error="Error ".$this->db->lasterror(); - dol_syslog("Tva::update ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR); return -1; } @@ -200,11 +198,12 @@ class Tva extends CommonObject } - /* - * \brief Load object in memory from database - * \param id id object - * \param user User that load - * \return int <0 if KO, >0 if OK + /** + * Load object in memory from database + * + * @param int $id id object + * @param User $user User that load + * @return int <0 if KO, >0 if OK */ function fetch($id, $user=0) { @@ -229,7 +228,7 @@ class Tva extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON t.fk_bank = b.rowid"; $sql.= " WHERE t.rowid = ".$id; - dol_syslog("Tva::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -259,17 +258,18 @@ class Tva extends CommonObject else { $this->error="Error ".$this->db->lasterror(); - dol_syslog("Tva::fetch ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; } } - /* - * \brief Delete object in database - * \param user User that delete - * \return int <0 if KO, >0 if OK - */ + /** + * Delete object in database + * + * @param User $user User that delete + * @return int <0 if KO, >0 if OK + */ function delete($user) { global $conf, $langs; @@ -279,12 +279,12 @@ class Tva extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."tva"; $sql.= " WHERE rowid=".$this->id; - dol_syslog("Tva::delete sql=".$sql); + dol_syslog(get_class($this)."::delete sql=".$sql); $resql = $this->db->query($sql); if (! $resql) { $this->error="Error ".$this->db->lasterror(); - dol_syslog("Tva::delete ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); return -1; } @@ -322,9 +322,11 @@ class Tva extends CommonObject } - /* - * \brief Hum la fonction s'appelle 'Solde' elle doit a mon avis calcluer le solde de TVA, non ? - * + /** + * Hum la fonction s'appelle 'Solde' elle doit a mon avis calcluer le solde de TVA, non ? + * + * @param int $year Year + * @return double Amount */ function solde($year = 0) { @@ -339,11 +341,12 @@ class Tva extends CommonObject return $solde; } - /* - * \brief Total de la TVA des factures emises par la societe. - * + /** + * Total de la TVA des factures emises par la societe. + * + * @param int $year Year + * @return double Amount */ - function tva_sum_collectee($year = 0) { @@ -352,7 +355,7 @@ class Tva extends CommonObject if ($year) { - $sql .= " AND f.datef >= '$year-01-01' AND f.datef <= '$year-12-31' "; + $sql .= " AND f.datef >= '".$year."-01-01' AND f.datef <= '".$year."-12-31' "; } $result = $this->db->query($sql); @@ -379,11 +382,12 @@ class Tva extends CommonObject } } - /* - * \brief Tva pay�e + /** + * VAT payed * + * @param int $year Year + * @return double Amount */ - function tva_sum_payee($year = 0) { @@ -392,7 +396,7 @@ class Tva extends CommonObject if ($year) { - $sql .= " WHERE f.datef >= '$year-01-01' AND f.datef <= '$year-12-31' "; + $sql .= " WHERE f.datef >= '".$year."-01-01' AND f.datef <= '".$year."-12-31' "; } $result = $this->db->query($sql); @@ -419,12 +423,12 @@ class Tva extends CommonObject } - /* - * \brief Tva r�gl�e - * Total de la TVA r�glee aupres de qui de droit + /** + * Total de la TVA reglee aupres de qui de droit * + * @param int $year Year + * @return double Amount */ - function tva_sum_reglee($year = 0) { @@ -433,7 +437,7 @@ class Tva extends CommonObject if ($year) { - $sql .= " WHERE f.datev >= '$year-01-01' AND f.datev <= '$year-12-31' "; + $sql .= " WHERE f.datev >= '".$year."-01-01' AND f.datev <= '".$year."-12-31' "; } $result = $this->db->query($sql); @@ -473,14 +477,16 @@ class Tva extends CommonObject $this->db->begin(); + // Clean parameters + $this->amount=price2num(trim($this->amount)); + // Check parameters - $this->amount=price2num($this->amount); if (! $this->label) { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")); return -3; } - if ($this->amount <= 0) + if ($this->amount < 0 || $this->amount == '') { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")); return -4; @@ -509,7 +515,7 @@ class Tva extends CommonObject $sql.=", '".$user->id."', NULL, ".$conf->entity; $sql.= ")"; - dol_syslog("Tva::addPayment sql=".$sql); + dol_syslog(get_class($this)."::addPayment sql=".$sql); $result = $this->db->query($sql); if ($result) { @@ -525,7 +531,7 @@ class Tva extends CommonObject if ($this->id > 0) { $ok=1; - if (! empty($conf->banque->enabled)) + if (! empty($conf->banque->enabled) && ! empty($this->amount)) { // Insertion dans llx_bank require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; @@ -536,7 +542,7 @@ class Tva extends CommonObject $bank_line_id = $acc->addline($this->datep, $this->paymenttype, $this->label, -abs($this->amount), '', '', $user); - // Mise a jour fk_bank dans llx_tva. On connait ainsi la ligne de tva qui a g�n�r� l'�criture bancaire + // Update fk_bank into llx_tva. So we know vat line used to generate bank transaction if ($bank_line_id > 0) { $this->update_fk_bank($bank_line_id); @@ -547,7 +553,7 @@ class Tva extends CommonObject $ok=0; } - // Mise a jour liens + // Update links $result=$acc->add_url_line($bank_line_id, $this->id, DOL_URL_ROOT.'/compta/tva/fiche.php?id=', "(VATPayment)", "payment_vat"); if ($result < 0) { diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php index f36fd0be5a5..cab62777291 100644 --- a/htdocs/compta/tva/fiche.php +++ b/htdocs/compta/tva/fiche.php @@ -34,8 +34,6 @@ $langs->load("bills"); $id=GETPOST("id"); $action=GETPOST('action'); -$mesg = ''; - // Security check $socid = isset($_GET["socid"])?$_GET["socid"]:''; if ($user->societe_id) $socid=$user->societe_id; @@ -82,7 +80,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) else { $db->rollback(); - $mesg='
'.$tva->error.'
'; + setEventMessage($tva->error, 'errors'); $action="create"; } } @@ -115,18 +113,18 @@ if ($action == 'delete') { $tva->error=$accountline->error; $db->rollback(); - $mesg='
'.$tva->error.'
'; + setEventMessage($tva->error,'errors'); } } else { $db->rollback(); - $mesg='
'.$tva->error.'
'; + setEventMessage($tva->error,'errors'); } } else { - $mesg='
Error try do delete a line linked to a conciliated bank transaction
'; + setEventMessage('Error try do delete a line linked to a conciliated bank transaction','errors'); } } @@ -159,8 +157,6 @@ if ($action == 'create') print_fiche_titre($langs->trans("NewVATPayment")); - if ($mesg) print $mesg; - print ''; print ""; @@ -213,8 +209,6 @@ if ($action == 'create') if ($id) { - if ($mesg) print $mesg; - $h = 0; $head[$h][0] = DOL_URL_ROOT.'/compta/tva/fiche.php?id='.$vatpayment->id; $head[$h][1] = $langs->trans('Card'); @@ -274,9 +268,20 @@ if ($id) */ print "
\n"; if ($vatpayment->rappro == 0) - print ''.$langs->trans("Delete").''; + { + if (! empty($user->rights->tax->charges->supprimer)) + { + print ''.$langs->trans("Delete").''; + } + else + { + print ''.$langs->trans("Delete").''; + } + } else + { print ''.$langs->trans("Delete").''; + } print "
"; } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index feaa996ad0c..61f722a1773 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -62,6 +62,10 @@ class Contact extends CommonObject var $code; var $email; + var $phone_pro; + var $phone_perso; + var $phone_mobile; + var $birthday; var $default_lang; var $note_public; // Public note diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 9c24972e383..f4271d05070 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -875,7 +875,7 @@ class ExtraFields if (!empty($value)) { $checked=' checked="checked" '; } - $value=''; + $value=''; } elseif ($type == 'mail') { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b756f0313a5..37dd19ffe04 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -800,7 +800,7 @@ class Form while ($i < $num) { $obj = $this->db->fetch_object($resql); - + $label=''; if ($conf->global->SOCIETE_ADD_REF_IN_LIST) { if (($obj->client) && (!empty($obj->code_client))) { $label = $obj->code_client. ' - '; @@ -2499,7 +2499,7 @@ class Form * @param string $action Action * @param array $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , )) * @param string $selectedchoice "" or "no" or "yes" - * @param int $useajax 0=No, 1 or 'xxx'=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=preoutput confirm box with div id=dialog-confirm-xxx + * @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx * @param int $height Force height of box * @param int $width Force width of bow * @return string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form @@ -2588,10 +2588,12 @@ class Form } // JQUI method dialog is broken with jmobile, we use standard HTML. - // Note: When using dol_use_jmobile, you must also check code for button use a GET url with action=xxx and output the confirm code only when action=xxx + // Note: When using dol_use_jmobile or no js, you must also check code for button use a GET url with action=xxx and check that you also output the confirm code when action=xxx + // See page product/fiche.php for example if (! empty($conf->dol_use_jmobile)) $useajax=0; + if (empty($conf->use_javascript_ajax)) $useajax=0; - if ($useajax && $conf->use_javascript_ajax) + if ($useajax) { $autoOpen=true; $dialogconfirm='dialog-confirm'; @@ -3657,18 +3659,19 @@ class Form * @param string $prefix prefix * @param int $iSecond Default preselected duration (number of seconds) * @param int $disabled Disable the combo box - * @param string $typehour if select then hour in select if text input in text + * @param string $typehour if 'select' then input hour and input min is a combo, if 'text' input hour is in text and input min is a combo * @return void */ function select_duration($prefix,$iSecond='',$disabled=0,$typehour='select') { global $langs; + $hourSelected=0; $minSelected=0; if ($iSecond) { require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - $hourSelected = convertSecondToTime($iSecond,'hour'); + $hourSelected = convertSecondToTime($iSecond,'allhour'); $minSelected = convertSecondToTime($iSecond,'min'); } @@ -3688,8 +3691,7 @@ class Form } elseif ($typehour=='text') { - $fullhours=convertSecondToTime($iSecond,'fullhour'); - print ''; + print ''; } print $langs->trans('Hours'). " "; print '"; + + if ($savingdocmask) + { + $out .= ''; + if (! empty($options)) $out .= ''; + $out .= ''; + $out .= ''; + } + $out .= "
'.$options.''; + $out .= ' '.$langs->trans("SaveUploadedFileWithMask", preg_replace('/__file__/',$langs->transnoentitiesnoconv("OriginFileName"),$savingdocmask), $langs->transnoentitiesnoconv("OriginFileName")); + $out .= '
"; $out .= ''; diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index dc137a06514..95eb057b547 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -202,25 +202,25 @@ function convertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0) /** Return, in clear text, value of a number of seconds in days, hours and minutes * * @param int $iSecond Number of seconds - * @param string $format Output format (all: complete display, hour: displays only hours, min: displays only minutes, sec: displays only seconds, month: display month only, year: displays only year); + * @param string $format Output format (all: total delay days hour:min like "2 days 12:30"", allhourmin: total delay hours:min like "60:30", allhour: total delay hours without min/sec like "60:30", fullhour: total delay hour decimal like "60.5" for 60:30, hour: only hours part "12", min: only minutes part "30", sec: only seconds part, month: only month part, year: only year part); * @param int $lengthOfDay Length of day (default 86400 seconds for 1 day, 28800 for 8 hour) * @param int $lengthOfWeek Length of week (default 7) * @return sTime Formated text of duration * Example: 0 return 00:00, 3600 return 1:00, 86400 return 1d, 90000 return 1 Day 01:00 */ -function convertSecondToTime($iSecond,$format='all',$lengthOfDay=86400,$lengthOfWeek=7) +function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengthOfWeek=7) { global $langs; if (empty($lengthOfDay)) $lengthOfDay = 86400; // 1 day = 24 hours if (empty($lengthOfWeek)) $lengthOfWeek = 7; // 1 week = 7 days - if ($format == 'all') + if ($format == 'all' || $format == 'allhour' || $format == 'allhourmin') { if ($iSecond === 0) return '0'; // This is to avoid having 0 return a 12:00 AM for en_US $sTime=''; - $sDay=0; + $sDay=0; $sWeek=''; if ($iSecond >= $lengthOfDay) @@ -246,13 +246,6 @@ function convertSecondToTime($iSecond,$format='all',$lengthOfDay=86400,$lengthOf if ($sWeek >= 2) $weekTranslate = $langs->trans("DurationWeeks"); $sTime.=$sWeek.' '.$weekTranslate.' '; } -/* if ($sDay>0) - { - $dayTranslate = $langs->trans("Day"); - if ($sDay > 1) $dayTranslate = $langs->trans("Days"); - $sTime.=$sDay.' '.$dayTranslate.' '; - } -*/ } } if ($sDay>0) @@ -262,13 +255,23 @@ function convertSecondToTime($iSecond,$format='all',$lengthOfDay=86400,$lengthOf $sTime.=$sDay.' '.$dayTranslate.' '; } -// if ($sDay) $sTime.=$sDay.' '.$dayTranslate.' '; - if ($iSecond || empty($sDay)) + if ($format == 'all') { - $sTime.= dol_print_date($iSecond,'hourduration',true); + if ($iSecond || empty($sDay)) + { + $sTime.= dol_print_date($iSecond,'hourduration',true); + } + } + if ($format == 'allhourmin') + { + return sprintf("%02d",($sWeek*$lengthOfWeek*24 + $sDay*24 + (int) floor($iSecond/3600))).':'.sprintf("%02d",((int) floor(($iSecond % 3600)/60))); + } + if ($format == 'allhour') + { + return sprintf("%02d",($sWeek*$lengthOfWeek*24 + $sDay*24 + (int) floor($iSecond/3600))); } } - else if ($format == 'hour') + else if ($format == 'hour') // only hour part { $sTime=dol_print_date($iSecond,'%H',true); } @@ -282,19 +285,19 @@ function convertSecondToTime($iSecond,$format='all',$lengthOfDay=86400,$lengthOf } $sTime=$iSecond; } - else if ($format == 'min') + else if ($format == 'min') // only min part { $sTime=dol_print_date($iSecond,'%M',true); } - else if ($format == 'sec') + else if ($format == 'sec') // only sec part { $sTime=dol_print_date($iSecond,'%S',true); } - else if ($format == 'month') + else if ($format == 'month') // only month part { $sTime=dol_print_date($iSecond,'%m',true); } - else if ($format == 'year') + else if ($format == 'year') // only year part { $sTime=dol_print_date($iSecond,'%Y',true); } @@ -340,7 +343,7 @@ function dol_stringtotime($string, $gm=1) else if ( preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})Z$/i',$string,$reg) // Convert date with format RFC3339 || preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})$/i',$string,$reg) // Convert date with format YYYY-MM-DD HH:MM:SS - || preg_match('/^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})Z$/i',$string,$reg) // Convert date with format YYYYMMDDTHHMMSSZ + || preg_match('/^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})Z$/i',$string,$reg) // Convert date with format YYYYMMDDTHHMMSSZ ) { $syear = $reg[1]; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 4494a5d1ff8..b2a19b2dfeb 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -994,18 +994,28 @@ function dol_init_file_process($pathtoscan='') * @param int $allowoverwrite 1=Allow overwrite existing file * @param int $donotupdatesession 1=Do no edit _SESSION variable * @param string $varfiles _FILES var name + * @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' * @return void */ -function dol_add_file_process($upload_dir,$allowoverwrite=0,$donotupdatesession=0,$varfiles='addedfile') +function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesession=0, $varfiles='addedfile', $savingdocmask='') { global $db,$user,$conf,$langs; if (! empty($_FILES[$varfiles])) // For view $_FILES[$varfiles]['error'] { - dol_syslog('dol_add_file_process upload_dir='.$upload_dir.' allowoverwrite='.$allowoverwrite.' donotupdatesession='.$donotupdatesession, LOG_DEBUG); + dol_syslog('dol_add_file_process upload_dir='.$upload_dir.' allowoverwrite='.$allowoverwrite.' donotupdatesession='.$donotupdatesession.' savingdocmask='.$savingdocmask, LOG_DEBUG); if (dol_mkdir($upload_dir) >= 0) { - $resupload = dol_move_uploaded_file($_FILES[$varfiles]['tmp_name'], $upload_dir . "/" . $_FILES[$varfiles]['name'], $allowoverwrite, 0, $_FILES[$varfiles]['error'], 0, $varfiles); + // Define $destpath (path to file including filename) and $destfile (only filename) + $destpath=$upload_dir . "/" . $_FILES[$varfiles]['name']; + $destfile=$_FILES[$varfiles]['name']; + if ($savingdocmask) + { + $destpath=$upload_dir . "/" . preg_replace('/__file__/',$_FILES[$varfiles]['name'],$savingdocmask); + $destfile=preg_replace('/__file__/',$_FILES[$varfiles]['name'],$savingdocmask); + } + + $resupload = dol_move_uploaded_file($_FILES[$varfiles]['tmp_name'], $destpath, $allowoverwrite, 0, $_FILES[$varfiles]['error'], 0, $varfiles); if (is_numeric($resupload) && $resupload > 0) { include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; @@ -1013,16 +1023,16 @@ function dol_add_file_process($upload_dir,$allowoverwrite=0,$donotupdatesession= { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); - $formmail->add_attached_files($upload_dir . "/" . $_FILES[$varfiles]['name'],$_FILES[$varfiles]['name'],$_FILES[$varfiles]['type']); + $formmail->add_attached_files($destpath, $destfile, $_FILES[$varfiles]['type']); } - if (image_format_supported($upload_dir . "/" . $_FILES[$varfiles]['name']) == 1) + if (image_format_supported($destpath) == 1) { // Create small thumbs for image (Ratio is near 16/9) // Used on logon for example - $imgThumbSmall = vignette($upload_dir . "/" . $_FILES[$varfiles]['name'], 160, 120, '_small', 50, "thumbs"); + $imgThumbSmall = vignette($destpath, 160, 120, '_small', 50, "thumbs"); // Create mini thumbs for image (Ratio is near 16/9) // Used on menu or for setup page for example - $imgThumbMini = vignette($upload_dir . "/" . $_FILES[$varfiles]['name'], 160, 120, '_mini', 50, "thumbs"); + $imgThumbMini = vignette($destpath, 160, 120, '_mini', 50, "thumbs"); } setEventMessage($langs->trans("FileTransferComplete")); diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index cffa4ff6a6d..907b78eaac1 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -345,7 +345,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS)) { // Tel - if ($targetcontact->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcontact->phone); + if ($targetcontact->phone_pro) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcontact->phone_pro); // Fax if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax); // EMail diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 3e257b1c4a6..1f8f380e494 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -75,7 +75,7 @@ function project_prepare_head($object) $head[$h][2] = 'notes'; $h++; } - + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $upload_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir,'files')); @@ -84,7 +84,7 @@ function project_prepare_head($object) if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; $head[$h][2] = 'document'; $h++; - + // Then tab for sub level of projet, i mean tasks $head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id; $head[$h][1] = $langs->trans("Tasks"); @@ -322,13 +322,20 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t print dol_print_date($lines[$i]->date_end,'day'); print ''; - // Planned Workload + // Planned Workload (in working hours) print ''; - if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'all'); - else print '--:--'; + $fullhour=convertSecondToTime($lines[$i]->planned_workload,'allhourmin'); + $workingdelay=convertSecondToTime($lines[$i]->planned_workload,'all',86400,7); // TODO Replace 86400 and 7 to take account working hours per day and working day per weeks + if ($lines[$i]->planned_workload) + { + print $fullhour; + // TODO Add delay taking account of working hours per day and working day per week + //if ($workingdelay != $fullhour) print '
('.$workingdelay.')'; + } + //else print '--:--'; print ''; - // Progress + // Progress declared print ''; print $lines[$i]->progress.' %'; print ''; @@ -337,12 +344,18 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t print ''; if ($showlineingray) print ''; else print ''; - if ($lines[$i]->duration) print convertSecondToTime($lines[$i]->duration,'all'); + if ($lines[$i]->duration) print convertSecondToTime($lines[$i]->duration,'allhourmin'); else print '--:--'; if ($showlineingray) print ''; else print ''; print ''; + // Progress calculated + // Note: ->duration is in fact time spent i think + print ''; + if ($lines[$i]->planned_workload) print round(100 * $lines[$i]->duration / $lines[$i]->planned_workload,2).' %'; + print ''; + // Tick to drag and drop if ($addordertick) { @@ -376,7 +389,8 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t print ''; print ''; if ($addordertick) print ''; - print ''.convertSecondToTime($total).''; + print ''.convertSecondToTime($total, 'allhourmin').''; + print ''; print ''; } @@ -494,7 +508,7 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr print ''; $s =$form->select_date('',$lines[$i]->id,'','','',"addtime",1,0,1,$disabledtask); $s.='   '; - $s.=$form->select_duration($lines[$i]->id,'',$disabledtask); + $s.=$form->select_duration($lines[$i]->id,'',$disabledtask,'text'); $s.=' '; print $s; print ''; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 6e623d183d2..79e515b05e5 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -52,12 +52,13 @@ abstract class DolibarrModules var $dbversion = "-"; + /** - * Fonction d'activation. Insere en base les constantes et boites du module + * Method to enable a module. Insert into database all constants, boxes of module * - * @param array $array_sql Array of SQL requests to execute when enabling module - * @param string $options Options when enabling module ('', 'noboxes') - * @return int 1 if OK, 0 if KO + * @param array $array_sql Array of SQL requests to execute when enabling module + * @param string $options String with options when disabling module ('newboxdefonly|noboxes') + * @return int 1 if OK, 0 if KO */ function _init($array_sql, $options='') { @@ -78,8 +79,8 @@ abstract class DolibarrModules // Insert constant defined by modules, into llx_const if (! $err) $err+=$this->insert_const(); - // Insere les boites dans llx_boxes_def - if (! $err && $options != 'noboxes') $err+=$this->insert_boxes(); + // Insert boxes def into llx_boxes_def and boxes setup into llx_boxes + if (! $err && ! preg_match('/noboxes/',$options)) $err+=$this->insert_boxes($options); // Insert permission definitions of module into llx_rights_def. If user is admin, grant this permission to user. if (! $err) $err+=$this->insert_permissions(1); @@ -147,7 +148,7 @@ abstract class DolibarrModules * Fonction de desactivation. Supprime de la base les constantes et boites du module * * @param array $array_sql Array of SQL requests to execute when disable module - * @param string $options Options when disabling module ('', 'noboxes') + * @param string $options String with options when disabling module ('newboxdefonly|noboxes') * @return int 1 if OK, 0 if KO */ function _remove($array_sql, $options='') @@ -170,7 +171,7 @@ abstract class DolibarrModules if (! $err) $err+=$this->delete_const(); // Remove list of module's available boxes (entry in llx_boxes) - if (! $err && $options != 'noboxes') $err+=$this->delete_boxes(); + if (! $err && ! preg_match('/(newboxdefonly|noboxes)/',$options)) $err+=$this->delete_boxes(); // We don't have to delete if option ask to keep boxes safe or ask to add new box def only // Remove module's permissions from list of available permissions (entries in llx_rights_def) if (! $err) $err+=$this->delete_permissions(); @@ -261,7 +262,7 @@ abstract class DolibarrModules /** - * Retourne la version du module. + * Return module version. * Pour les modules a l'etat 'experimental', retourne la traduction de 'experimental' * Pour les modules 'dolibarr', retourne la version de Dolibarr * Pour les autres modules, retourne la version du module @@ -281,6 +282,20 @@ abstract class DolibarrModules } + /** + * Return if a module is a core or external module + * + * @return string 'core', 'external' or 'unknown' + */ + function isCoreOrExternalModule() + { + if ($this->version == 'dolibarr') return 'core'; + if (! empty($this->version) && ! in_array($this->version,array('experimental','development'))) return 'external'; + if (! empty($this->editor_name) || ! empty($this->editor_web)) return 'external'; + return 'unknown'; + } + + /** * Return list of lang files related to module * @@ -419,7 +434,7 @@ abstract class DolibarrModules if (empty($reldir)) return 1; include_once DOL_DOCUMENT_ROOT .'/core/lib/admin.lib.php'; - + $ok = 1; foreach($conf->file->dol_document_root as $dirroot) { @@ -497,9 +512,10 @@ abstract class DolibarrModules /** * Insert boxes into llx_boxes_def * - * @return int Nb of errors (0 if OK) + * @param string $option String with options when disabling module ('newboxdefonly'=insert only boxes definition) + * @return int Nb of errors (0 if OK) */ - function insert_boxes() + function insert_boxes($option='') { require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; @@ -518,11 +534,13 @@ abstract class DolibarrModules if (empty($file)) $file = isset($this->boxes[$key][1])?$this->boxes[$key][1]:''; // For backward compatibility if (empty($note)) $note = isset($this->boxes[$key][2])?$this->boxes[$key][2]:''; // For backward compatibility + // Search if boxes def already present $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."boxes_def"; $sql.= " WHERE file = '".$this->db->escape($file)."'"; $sql.= " AND entity = ".$conf->entity; if ($note) $sql.=" AND note ='".$this->db->escape($note)."'"; + dol_syslog(get_class($this)."::insert_boxes sql=".$sql); $result=$this->db->query($sql); if ($result) { @@ -533,9 +551,9 @@ abstract class DolibarrModules if (! $err) { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes_def (file,entity,note)"; - $sql.= " VALUES ('".$this->db->escape($file)."',"; - $sql.= $conf->entity.","; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes_def (file, entity, note)"; + $sql.= " VALUES ('".$this->db->escape($file)."', "; + $sql.= $conf->entity.", "; $sql.= $note?"'".$this->db->escape($note)."'":"null"; $sql.= ")"; @@ -544,7 +562,7 @@ abstract class DolibarrModules if (! $resql) $err++; } - if (! $err) + if (! $err && ! preg_match('/newboxdefonly/',$options)) { $lastid=$this->db->last_insert_id(MAIN_DB_PREFIX."boxes_def","rowid"); @@ -568,7 +586,7 @@ abstract class DolibarrModules $this->db->commit(); } else - { + { $this->error=$this->db->lasterror(); dol_syslog(get_class($this)."::insert_boxes ".$this->error, LOG_ERR); $this->db->rollback(); @@ -609,7 +627,7 @@ abstract class DolibarrModules //$note = $this->boxes[$key][2]; if (empty($file)) $file = isset($this->boxes[$key][1])?$this->boxes[$key][1]:''; // For backward compatibility - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes"; $sql.= " USING ".MAIN_DB_PREFIX."boxes, ".MAIN_DB_PREFIX."boxes_def"; $sql.= " WHERE ".MAIN_DB_PREFIX."boxes.box_id = ".MAIN_DB_PREFIX."boxes_def.rowid"; @@ -898,7 +916,7 @@ abstract class DolibarrModules break; } else dol_syslog(get_class($this)."::insert_permissions record already exists", LOG_INFO); - + } $this->db->free($resqlinsert); diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 779cf75ea64..f9d552c286b 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -194,7 +194,7 @@ class modCommande extends DolibarrModules * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. * It also creates data directories * - * @param string $options Options when enabling module ('', 'noboxes') + * @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes') * @return int 1 if OK, 0 if KO */ function init($options='') @@ -236,7 +236,7 @@ class modCommande extends DolibarrModules * Remove from database constants, boxes and permissions from Dolibarr database. * Data directories are not deleted * - * @param string $options Options when enabling module ('', 'noboxes') + * @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes') * @return int 1 if OK, 0 if KO */ function remove($options='') diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index bb56366182d..08bd0e008ac 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -221,7 +221,7 @@ class modFacture extends DolibarrModules * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. * It also creates data directories * - * @param string $options Options when enabling module ('', 'noboxes') + * @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes') * @return int 1 if OK, 0 if KO */ function init($options='') @@ -262,7 +262,7 @@ class modFacture extends DolibarrModules * Remove from database constants, boxes and permissions from Dolibarr database. * Data directories are not deleted * - * @param string $options Options when enabling module ('', 'noboxes') + * @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes') * @return int 1 if OK, 0 if KO */ function remove($options='') diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index ecca09e136e..088c688a4fd 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -89,11 +89,12 @@ class modProduct extends DolibarrModules $r++; // Boxes - $this->boxes = array(); - $this->boxes[0][1] = "box_produits.php"; - $this->boxes[1][1] = "box_produits_alerte_stock.php"; - $this->boxes[2][1] = "box_graph_product_distribution.php"; - + $this->boxes = array( + 0=>array('file'=>'box_produits.php','enabledbydefaulton'=>'Home'), + 1=>array('file'=>'box_produits_alerte_stock.php','enabledbydefaulton'=>''), + 2=>array('file'=>'box_graph_product_distribution.php','enabledbydefaulton'=>'Home') + ); + // Permissions $this->rights = array(); $this->rights_class = 'produit'; @@ -244,7 +245,7 @@ class modProduct extends DolibarrModules 'sp.remise_percent'=>'0' ); } - + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { // Exports product multiprice //-------- @@ -268,12 +269,12 @@ class modProduct extends DolibarrModules $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_price as pr ON p.rowid = pr.fk_product'; $this->export_sql_end[$r] .=' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity("product", 1).')'; - - + + // Import product multiprice //-------- $r=0; - + $r++; $this->import_code[$r]=$this->rights_class.'_'.$r; $this->import_label[$r]="ProductsMultiPrice"; // Translation key @@ -304,7 +305,7 @@ class modProduct extends DolibarrModules * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. * It also creates data directories * - * @param string $options Options when enabling module ('', 'noboxes') + * @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes') * @return int 1 if OK, 0 if KO */ function init($options='') @@ -322,7 +323,7 @@ class modProduct extends DolibarrModules * Remove from database constants, boxes and permissions from Dolibarr database. * Data directories are not deleted * - * @param string $options Options when enabling module ('', 'noboxes') + * @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes') * @return int 1 if OK, 0 if KO */ function remove($options='') diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 09e8116af41..eb472a25799 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -75,8 +75,10 @@ class modService extends DolibarrModules $this->const = array(); // Boxes - $this->boxes = array(); - $this->boxes[0][1] = "box_services_contracts.php"; + $this->boxes = array( + 0=>array('file'=>'box_services_contracts.php','enabledbydefaulton'=>'Home'), + 1=>array('file'=>'box_graph_product_distribution.php','enabledbydefaulton'=>'Home') + ); // Permissions $this->rights = array(); @@ -186,7 +188,7 @@ class modService extends DolibarrModules * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. * It also creates data directories * - * @param string $options Options when enabling module ('', 'noboxes') + * @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes') * @return int 1 if OK, 0 if KO */ function init($options='') @@ -204,7 +206,7 @@ class modService extends DolibarrModules * Remove from database constants, boxes and permissions from Dolibarr database. * Data directories are not deleted * - * @param string $options Options when enabling module ('', 'noboxes') + * @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes') * @return int 1 if OK, 0 if KO */ function remove($options='') diff --git a/htdocs/core/modules/syslog/mod_syslog_chromephp.php b/htdocs/core/modules/syslog/mod_syslog_chromephp.php index 0d838959166..e8291a2daf3 100644 --- a/htdocs/core/modules/syslog/mod_syslog_chromephp.php +++ b/htdocs/core/modules/syslog/mod_syslog_chromephp.php @@ -117,6 +117,10 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface */ public function export($content) { + global $conf; + + if (! empty($conf->global->MAIN_SYSLOG_DISABLE_CHROMEPHP)) return; // Global option to disable output of this handler + //We check the configuration to avoid showing PHP warnings if (count($this->checkConfiguration())) return false; diff --git a/htdocs/core/modules/syslog/mod_syslog_file.php b/htdocs/core/modules/syslog/mod_syslog_file.php index 3a03d20ed00..ddb30df4e45 100644 --- a/htdocs/core/modules/syslog/mod_syslog_file.php +++ b/htdocs/core/modules/syslog/mod_syslog_file.php @@ -116,6 +116,8 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface { global $conf, $dolibarr_main_prod; + if (! empty($conf->global->MAIN_SYSLOG_DISABLE_FILE)) return; // Global option to disable output of this handler + $logfile = $this->getFilename($suffixinfilename); if (defined("SYSLOG_FILE_NO_ERROR")) $filefd = @fopen($logfile, 'a+'); diff --git a/htdocs/core/modules/syslog/mod_syslog_firephp.php b/htdocs/core/modules/syslog/mod_syslog_firephp.php index 311c43ca207..4a95a89862f 100644 --- a/htdocs/core/modules/syslog/mod_syslog_firephp.php +++ b/htdocs/core/modules/syslog/mod_syslog_firephp.php @@ -115,6 +115,10 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface */ public function export($content) { + global $conf; + + if (! empty($conf->global->MAIN_SYSLOG_DISABLE_FIREPHP)) return; // Global option to disable output of this handler + //We check the configuration to avoid showing PHP warnings if (count($this->checkConfiguration())) return false; diff --git a/htdocs/core/modules/syslog/mod_syslog_syslog.php b/htdocs/core/modules/syslog/mod_syslog_syslog.php index 09353dc5119..9b0d854e2e8 100644 --- a/htdocs/core/modules/syslog/mod_syslog_syslog.php +++ b/htdocs/core/modules/syslog/mod_syslog_syslog.php @@ -108,6 +108,10 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface */ public function export($content) { + global $conf; + + if (! empty($conf->global->MAIN_SYSLOG_DISABLE_SYSLOG)) return; // Global option to disable output of this handler + if (defined("SYSLOG_FACILITY") && constant("SYSLOG_FACILITY")) { if (constant(constant('SYSLOG_FACILITY'))) diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 102a2a8bcc1..638a6ac5969 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -29,7 +29,7 @@ print top_htmlhead('',$langs->trans('Login').' '.$title); ?> - + - + @@ -44,39 +44,62 @@ This page is a sample of page using tables. To make test with

+Example 0 : Table with div and table with table containg a select that should be overflowed and truncated
+
+ +
+
+ + +
+ +
+ + +
Example 1 : Table using tags: div.tagtable+form+div or div.tagtable+div.tagtr+div.tagtd
-use_javascript_ajax) && $object->statut == 0) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; ?> + + +
-
-
line1
-
-
-
-
-
-
line2
-
dfsdf
-
-
-
-
+
line3
dfsdf
-
-
+
ffdsfsd
+
aaaa
-
+
line4
dfsdf
-
+
bbbb
+
+
line5
+
dfsdf
+
+
bbbb
+
+ +
@@ -215,7 +238,7 @@ $('xxxth').replaceWith(
Example 3 : Standard table
-use_javascript_ajax) && $object->statut == 0) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 67c58c9d664..fb273b79ab3 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -910,11 +910,11 @@ else // Type - Size print ''.$langs->trans("ThirdPartyType").''."\n"; - print $form->selectarray("typent_id",$formcompany->typent_array(0), $object->typent_id); + print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print ''; print ''.$langs->trans("Staff").''; - print $form->selectarray("effectif_id",$formcompany->effectif_array(0), $object->effectif_id); + print $form->selectarray("effectif_id", $formcompany->effectif_array(0), $object->effectif_id); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print ''; @@ -1360,7 +1360,7 @@ else // Type - Size print ''.$langs->trans("ThirdPartyType").''; - print $form->selectarray("typent_id",$formcompany->typent_array(0), $object->typent_id); + print $form->selectarray("typent_id",$formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print ''; print ''.$langs->trans("Staff").''; diff --git a/htdocs/societe/tpl/linesalesrepresentative.tpl.php b/htdocs/societe/tpl/linesalesrepresentative.tpl.php index 9b2867cacff..70c9ec283c0 100644 --- a/htdocs/societe/tpl/linesalesrepresentative.tpl.php +++ b/htdocs/societe/tpl/linesalesrepresentative.tpl.php @@ -4,7 +4,7 @@ print '
'; print $langs->trans('SalesRepresentatives'); print ''; - if ($user->rights->societe->creer) + if ($user->rights->societe->creer && $user->rights->societe->client->voir) print ''.img_edit().''; else print ' '; diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 85deb2039f6..3fe179ad34f 100644 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -1159,14 +1159,14 @@ table.notopnoleftnoright { margin:0px; } -table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col { +table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col, div.border { border:1px solid #dddddd; border-collapse:collapse; padding:1px 0px; padding-left:2px; } -table.border td { +table.border td, div.border div div.tagtd { padding:1px 0px; border:1px solid #dddddd; border-collapse:collapse; @@ -2226,6 +2226,9 @@ ul.ulmenu { .ui-mobile fieldset { border-bottom: none !important; } +.ui-body-c, .ui-btn-up-c, .ui-btn-hover-c { + border: none !important; +} /* Style for first level menu with jmobile */ .ui-bar-b { diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index f32449c5d0a..9dcae0fd305 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -1245,19 +1245,19 @@ margin: 0px 0px 0px 0px; } -table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col { +table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col, div.border { border: 1px solid #9CACBB; border-collapse: collapse; padding: 1px 2px 2px 1px; /* t r b l */ } -table.border td { +table.border td, div.border div div.tagtd { padding: 1px 2px; border: 1px solid #9CACBB; border-collapse: collapse; } -td.border { +td.border, div.tagtable div div.border { border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; @@ -2398,6 +2398,9 @@ ul.ulmenu { .ui-mobile fieldset { border-bottom: none !important; } +.ui-body-c, .ui-btn-up-c, .ui-btn-hover-c { + border: none !important; +} /* Style for first level menu with jmobile */ .ui-bar-b, .lilevel0 { diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 3929686a2e1..24ad3f941e7 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -1369,7 +1369,7 @@ margin: 0px 0px 0px 0px; } -table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col { +table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col, div.border { border-collapse: collapse; padding: 10px; border-spacing: 2px; @@ -1391,7 +1391,7 @@ table.border.formdoc td { border: none; } -table.border td { +table.border td, div.border div div.tagtd { padding: 4px; border: 1px solid #EFEFEF; border-spacing: 0px; @@ -1403,7 +1403,7 @@ table.border table td { border: none; } -td.border { +td.border, div.tagtable div div.border { border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; @@ -2561,6 +2561,9 @@ ul.ulmenu { border-radius: 0; -webkit-border-radius: 0; } +.ui-body-c, .ui-btn-up-c, .ui-btn-hover-c { + border: none !important; +} /* Style for first level menu with jmobile */ .ui-bar-b, .lilevel0 { diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index 629730da160..23854bec688 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -1402,19 +1402,19 @@ margin: 0px 0px 0px 0px; } -table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col { +table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col, div.border { border: 1px solid #9CACBB; border-collapse: collapse; padding: 1px 2px; } -table.border td { +table.border td, div.border div div.tagtd { padding: 1px 2px; border: 1px solid #9CACBB; border-collapse: collapse; } -td.border { +td.border, div.tagtable div div.border { border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; @@ -2482,6 +2482,9 @@ ul.ulmenu { color: # !important; } +.ui-body-c, .ui-btn-up-c, .ui-btn-hover-c { + border: none !important; +} .alilevel0 { color: # !important; text-shadow: 1px 0px 1px #; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index db7500f12ce..0adafcccc0a 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -614,7 +614,7 @@ li.tmenu, li.tmenusel { li.tmenusel, li.tmenu:hover { background-image: -o-linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.3) 100%) !important; background-image: -moz-linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.3) 100%) !important; - background-image: -webkit-linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.3) 100%) !important; + background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0) 100%) !important; background-image: -ms-linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.3) 100%) !important; background-image: linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.3) 100%) !important; background: rgb(); @@ -1605,19 +1605,19 @@ span.butAction, span.butActionDelete { } -table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col { +table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col, div.border { border: 1px solid #D0D0D0; border-collapse: collapse; padding: 1px 2px 1px 3px; /* t r b l */ } -table.border td { +table.border td, div.border div div.tagtd { padding: 1px 2px 1px 2px; border: 1px solid #D0D0D0; border-collapse: collapse; } -td.border { +td.border, div.tagtable div div.border { border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; @@ -2831,6 +2831,9 @@ ul.ulmenu { color: # !important; text-shadow: 1px 0px 1px #; } +.ui-body-c, .ui-btn-up-c, .ui-btn-hover-c { + border: none !important; +} .ui-btn-up-c .vsmenudisabled { color: # !important; text-shadow: none !important; @@ -2840,14 +2843,6 @@ ul.ulmenu { text-shadow: 1px 0px 1px #; } .lilevel1 { - background-image: -webkit-gradient(linear,left top,left bottom,from( #eee ),to( #e1e1e1 )) !important; - background-image: -webkit-linear-gradient( #eee,#e1e1e1 ) !important; - background-image: -moz-linear-gradient( #eee,#e1e1e1 ) !important; - background-image: -ms-linear-gradient( #eee,#e1e1e1 ) !important; - background-image: -o-linear-gradient( #eee,#e1e1e1 ) !important; - background-image: linear-gradient( #eee,#e1e1e1 ) !important; -} -.lilevel1:hover, .lilevel2:hover, .lilevel3:hover, .lilevel4:hover { background-image: -webkit-gradient(linear,left top,left bottom,from( #ddd ),to( #d1d1d1 )) !important; background-image: -webkit-linear-gradient( #ddd,#d1d1d1 ) !important; background-image: -moz-linear-gradient( #ddd,#d1d1d1 ) !important; @@ -2855,7 +2850,22 @@ ul.ulmenu { background-image: -o-linear-gradient( #ddd,#d1d1d1 ) !important; background-image: linear-gradient( #ddd,#d1d1d1 ) !important; } - +.lilevel1:hover, .lilevel2:hover, .lilevel3:hover, .lilevel4:hover { + background-image: -webkit-gradient(linear,left top,left bottom,from( #ccc ),to( #c1c1c1 )) !important; + background-image: -webkit-linear-gradient( #ccc,#c1c1c1 ) !important; + background-image: -moz-linear-gradient( #ccc,#c1c1c1 ) !important; + background-image: -ms-linear-gradient( #ccc,#c1c1c1 ) !important; + background-image: -o-linear-gradient( #ccc,#c1c1c1 ) !important; + background-image: linear-gradient( #ccc,#c1c1c1 ) !important; +} + +.overflowwithjm200 +{ + max-width: 200px; + overflow: hidden; + white-space: nowrap; +} + close(); diff --git a/htdocs/webservices/admin/webservices.php b/htdocs/webservices/admin/webservices.php index 2de3c12df2c..7b71e5a0228 100644 --- a/htdocs/webservices/admin/webservices.php +++ b/htdocs/webservices/admin/webservices.php @@ -102,6 +102,7 @@ print '

'; $webservices = array( 'user' => '', 'thirdparty' => '!empty($conf->societe->enabled)', + 'contact' => '!empty($conf->societe->enabled)', 'productorservice' => '(!empty($conf->product->enabled) || !empty($conf->service->enabled))', 'order' => '!empty($conf->commande->enabled)', 'invoice' => '!empty($conf->facture->enabled)', diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index 08d21d5cba2..cfe25afbe4c 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -300,7 +300,7 @@ function getContact($authentication,$id,$ref='',$ref_ext='') 'ref_propal' => $contact->ref_propal, 'user_id' => $contact->user_id, 'user_login' => $contact->user_login, - 'civility_id' => $contact->civility_id + 'civilite_id' => $contact->civility_id ); //Retreive all extrafield for thirdsparty @@ -379,7 +379,7 @@ function createContact($authentication,$contact) $newobject=new Contact($db); $newobject->id=$contact['id']; - $newobject->civility_id=$contact['civility_id']; + $newobject->civilite_id=$contact['civility_id']; $newobject->lastname=$contact['lastname']; $newobject->firstname=$contact['firstname']; $newobject->address=$contact['address']; @@ -522,7 +522,7 @@ function getContactsForThirdParty($authentication,$idthirdparty) $linescontact[]=array( 'id' => $contact->id, 'ref' => $contact->ref, - 'civility_id' => $contact->civility_id?$contact->civility_id:'', + 'civility_id' => $contact->civilite_id?$contact->civilite_id:'', 'lastname' => $contact->lastname?$contact->lastname:'', 'firstname' => $contact->firstname?$contact->firstname:'', 'address' => $contact->address?$contact->address:'', @@ -653,6 +653,8 @@ function updateContact($authentication,$contact) $object->fax=$contact['fax']; $object->email=$contact['email']; + $object->civilite_id=$contact['civility_id']; + //Retreive all extrafield for contact // fetch optionals attributes and labels