diff --git a/build/.gitignore b/build/.gitignore old mode 100755 new mode 100644 diff --git a/build/aps/APP-META-1.1.xml b/build/aps/APP-META-1.1.xml old mode 100755 new mode 100644 diff --git a/build/aps/APP-META-1.2.xml b/build/aps/APP-META-1.2.xml old mode 100755 new mode 100644 diff --git a/build/aps/README b/build/aps/README old mode 100755 new mode 100644 diff --git a/build/aps/install.forced.php.install b/build/aps/install.forced.php.install old mode 100755 new mode 100644 index 199ed892355dc3fd0aa8a30aef74fd76a6b2cf7b..a7a3f03c14ca809ce1a4b3fe8281b51023c4c59e --- a/build/aps/install.forced.php.install +++ b/build/aps/install.forced.php.install @@ -21,4 +21,3 @@ $force_install_databaserootpass=''; $force_install_dolibarrlogin='admin'; $force_install_nophpinfo='1'; $force_install_lockinstall='444'; -?> \ No newline at end of file diff --git a/build/debian/conf.php.install b/build/debian/conf.php.install old mode 100755 new mode 100644 index e439e80caef4d883bb8019a9e651e60b94c0a392..c0ba3bdb1205a6057e6770d9d4e0db9c5f03ee59 --- a/build/debian/conf.php.install +++ b/build/debian/conf.php.install @@ -226,5 +226,3 @@ $dolibarr_main_prod='0'; # Default value: 0 (use database value if exist) # Examples: # $dolibarr_mailing_limit_sendbyweb='0'; - -?> diff --git a/build/debian/dolibarr.install b/build/debian/dolibarr.install old mode 100755 new mode 100644 diff --git a/build/debian/dolibarr.lintian-overrides b/build/debian/dolibarr.lintian-overrides old mode 100755 new mode 100644 diff --git a/build/debian/dolibarr.templates.futur b/build/debian/dolibarr.templates.futur old mode 100755 new mode 100644 diff --git a/build/debian/install.forced.php.install b/build/debian/install.forced.php.install old mode 100755 new mode 100644 index a6347863b1d9c55b9d3329b02016f77494b73dfa..099aab0675a2a31c12df095a1880c908b7969f65 --- a/build/debian/install.forced.php.install +++ b/build/debian/install.forced.php.install @@ -42,5 +42,3 @@ $force_install_lockinstall='444'; //$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; //$force_dolibarr_js_JQUERY_FLOT='/javascript/flot'; //$force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf'; - -?> \ No newline at end of file diff --git a/build/debian/po/POTFILES.in b/build/debian/po/POTFILES.in old mode 100755 new mode 100644 diff --git a/build/debian/po/fr.po b/build/debian/po/fr.po old mode 100755 new mode 100644 diff --git a/build/doxygen/doxygen_footer.html b/build/doxygen/doxygen_footer.html old mode 100755 new mode 100644 diff --git a/build/doxygen/doxygen_header.html b/build/doxygen/doxygen_header.html old mode 100755 new mode 100644 diff --git a/build/rpm/conf.php b/build/rpm/conf.php old mode 100755 new mode 100644 diff --git a/build/rpm/dolibarr-forrpm.patch b/build/rpm/dolibarr-forrpm.patch old mode 100755 new mode 100644 diff --git a/build/rpm/dolibarr.desktop b/build/rpm/dolibarr.desktop old mode 100755 new mode 100644 diff --git a/build/rpm/file_contexts.dolibarr b/build/rpm/file_contexts.dolibarr old mode 100755 new mode 100644 diff --git a/build/rpm/install.forced.php.fedora b/build/rpm/install.forced.php.fedora old mode 100755 new mode 100644 index 994689bbfa1657bbb6361b60a01b1cccb0dff01b..108455a940396029214ec461446a3e25f5234875 --- a/build/rpm/install.forced.php.fedora +++ b/build/rpm/install.forced.php.fedora @@ -31,5 +31,3 @@ $force_dolibarr_lib_TCPDF_PATH=''; //$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; //$force_dolibarr_js_JQUERY_FLOT='/javascript/flot'; $force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf'; - -?> \ No newline at end of file diff --git a/build/rpm/install.forced.php.generic b/build/rpm/install.forced.php.generic old mode 100755 new mode 100644 index 718eade3696030aaf1a174d46ad4ac5f1e9b0c68..161f69cdbb3a57099c5a95fc216d3e4e65db9257 --- a/build/rpm/install.forced.php.generic +++ b/build/rpm/install.forced.php.generic @@ -20,4 +20,3 @@ $force_install_lockinstall='444'; // Value to overwrite path to use shared libraries/fonts instead of embedded one // We don't force any external lib with generic package -?> \ No newline at end of file diff --git a/build/rpm/install.forced.php.mandriva b/build/rpm/install.forced.php.mandriva old mode 100755 new mode 100644 index 53a8a53b60cf393fa82cd1971c7c6617064a5cb2..266468c7f334c96f4249494279971d40cef05152 --- a/build/rpm/install.forced.php.mandriva +++ b/build/rpm/install.forced.php.mandriva @@ -31,5 +31,3 @@ $force_dolibarr_lib_TCPDF_PATH=''; //$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; //$force_dolibarr_js_JQUERY_FLOT='/javascript/flot'; $force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/TTF/dejavu/DejaVuSans-Bold.ttf'; - -?> \ No newline at end of file diff --git a/build/rpm/install.forced.php.opensuse b/build/rpm/install.forced.php.opensuse old mode 100755 new mode 100644 index 06a0074b04d55ac488e52dd0366d466d92fcfa4d..b644cea6e249fd2d58d8bffe8962f2fbe2eefa01 --- a/build/rpm/install.forced.php.opensuse +++ b/build/rpm/install.forced.php.opensuse @@ -31,5 +31,3 @@ $force_dolibarr_lib_TCPDF_PATH=''; //$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; //$force_dolibarr_js_JQUERY_FLOT='/javascript/flot'; $force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype/DejaVuSans-Bold.ttf'; - -?> \ No newline at end of file diff --git a/dev/codesniffer/README b/dev/codesniffer/README old mode 100755 new mode 100644 diff --git a/dev/codesniffer/php.ini b/dev/codesniffer/php.ini old mode 100755 new mode 100644 diff --git a/dev/codesniffer/ruleset.dtd b/dev/codesniffer/ruleset.dtd old mode 100755 new mode 100644 diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml old mode 100755 new mode 100644 diff --git a/dev/codetemplates/README b/dev/codetemplates/README old mode 100755 new mode 100644 diff --git a/dev/codetemplates/codetemplates.dtd b/dev/codetemplates/codetemplates.dtd old mode 100755 new mode 100644 diff --git a/dev/codetemplates/codetemplates.xml b/dev/codetemplates/codetemplates.xml old mode 100755 new mode 100644 diff --git a/dev/examples/README b/dev/examples/README old mode 100755 new mode 100644 diff --git a/dev/iso-normes/GURULABS-RPM-GUIDE-v1.0.PDF b/dev/iso-normes/GURULABS-RPM-GUIDE-v1.0.PDF old mode 100755 new mode 100644 diff --git a/dev/iso-normes/address_format.txt b/dev/iso-normes/address_format.txt old mode 100755 new mode 100644 diff --git a/dev/iso-normes/banknumber_format.txt b/dev/iso-normes/banknumber_format.txt old mode 100755 new mode 100644 diff --git a/dev/iso-normes/xmlexport.txt b/dev/iso-normes/xmlexport.txt old mode 100755 new mode 100644 diff --git a/dev/phpunit/README b/dev/phpunit/README old mode 100755 new mode 100644 diff --git a/dev/phpunit/eclipse_setup_for_pti_phpunit.png b/dev/phpunit/eclipse_setup_for_pti_phpunit.png old mode 100755 new mode 100644 diff --git a/dev/skeletons/build_webservice_from_class.php b/dev/skeletons/build_webservice_from_class.php old mode 100644 new mode 100755 diff --git a/doc/images/appicon_128.png b/doc/images/appicon_128.png old mode 100755 new mode 100644 diff --git a/doc/images/appicon_16.ico b/doc/images/appicon_16.ico old mode 100755 new mode 100644 diff --git a/doc/images/appicon_16.png b/doc/images/appicon_16.png old mode 100755 new mode 100644 diff --git a/doc/images/appicon_32.png b/doc/images/appicon_32.png old mode 100755 new mode 100644 diff --git a/doc/images/appicon_48.ico b/doc/images/appicon_48.ico old mode 100755 new mode 100644 diff --git a/doc/images/appicon_64.png b/doc/images/appicon_64.png old mode 100755 new mode 100644 diff --git a/doc/images/dolibarr_73x73.png b/doc/images/dolibarr_73x73.png old mode 100755 new mode 100644 diff --git a/doc/images/dolibarr_logo.png b/doc/images/dolibarr_logo.png old mode 100755 new mode 100644 diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index ec1087386471b2389c18929c470cb17035d497d7..b6f412d5480042637c20c8028a9710b450055c15 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -84,6 +84,19 @@ elseif ($action == 'delbookkeepingyear') { $delyear = GETPOST('delyear', 'int'); + if (! empty($delyear)) { + $object = new BookKeeping($db); + $result = $object->delete_by_year($delyear); + Header("Location: list.php"); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } +} +elseif ($action == 'delbookkeepingyear') { + + $delyear = GETPOST('delyear', 'int'); + if (! empty($delyear)) { $object = new BookKeeping($db); $result = $object->delete_by_year($delyear); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 0045316d41995152dc5197a56e55ce097ddd3959..c5630d8c6c14dfcd7e12b928af022e4d1be2d0aa 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -725,7 +725,7 @@ if ($id > 0) { $contratstatic=new Contrat($db); - $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut, c.datec as dc"; + $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut, c.datec as dc, c.date_contrat as dcon, c.ref_supplier as refsup"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; $sql.= " WHERE c.fk_soc = s.rowid "; $sql.= " AND s.rowid = ".$object->id; @@ -742,7 +742,7 @@ if ($id > 0) print '<table class="noborder" width="100%">'; print '<tr class="liste_titre">'; - print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).'</td>'; + print '<td colspan="6"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).'</td>'; print '<td align="right"><a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->id.'">'.$langs->trans("AllContracts").' <span class="badge">'.$num.'</span></a></td></tr></table></td>'; print '</tr>'; } @@ -759,7 +759,9 @@ if ($id > 0) $contrat->ref=$objp->ref?$objp->ref:$objp->id; print $contrat->getNomUrl(1,12); print "</td>\n"; + print '<td class="nowrap">'.dol_trunc($objp->refsup,12)."</td>\n"; print '<td align="right" width="80">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n"; + print '<td align="right" width="80">'.dol_print_date($db->jdate($objp->dcon),'day')."</td>\n"; print '<td width="20"> </td>'; print '<td align="right" class="nowrap">'; $contrat->fetch_lines(); diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 3befe2cf0cbfb6a489f99c1b60a04c7f461f2390..7ac91d1ab3142a2d180112c81ee7a04a6118340f 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -554,11 +554,11 @@ class Mailing extends CommonObject if ($mode == 0) { - return $langs->trans($this->statut_dest[$statut]); + return $langs->trans('MailingStatusError'); } if ($mode == 1) { - return $langs->trans($this->statut_dest[$statut]); + return $langs->trans('MailingStatusSent'); } if ($mode == 2) { diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 903977da46083ce1774e61a4beb35c4219eabde0..934c970accff0961fac9729d5e545be123b73b88 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -115,7 +115,7 @@ else if ($action == 'add' && $user->rights->deplacement->creer) $error=0; $object->date = dol_mktime(12, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int')); - $object->km = GETPOST('km','int'); + $object->km = price2num(GETPOST('km','alpha'), 'MU'); // Not 'int', it may be a formated amount $object->type = GETPOST('type','alpha'); $object->socid = GETPOST('socid','int'); $object->fk_user = GETPOST('fk_user','int'); @@ -174,7 +174,7 @@ else if ($action == 'update' && $user->rights->deplacement->creer) $result = $object->fetch($id); $object->date = dol_mktime(12, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int')); - $object->km = GETPOST('km','int'); + $object->km = price2num(GETPOST('km','alpha'), 'MU'); // Not 'int', it may be a formated amount $object->type = GETPOST('type','alpha'); $object->socid = GETPOST('socid','int'); $object->fk_user = GETPOST('fk_user','int'); diff --git a/htdocs/compta/facture/mergepdftool.php b/htdocs/compta/facture/mergepdftool.php index 64a823e8e4a2b025d5eeef5db8dfc43cf6947453..5d18dc054338fbd435cbbc55cc8b2f96106429d6 100644 --- a/htdocs/compta/facture/mergepdftool.php +++ b/htdocs/compta/facture/mergepdftool.php @@ -70,6 +70,11 @@ $diroutputpdf=$conf->facture->dir_output . '/unpaid/temp'; if (! $user->rights->societe->client->voir || $socid) $diroutputpdf.='/private/'.$user->id; // If user has no permission to see all, output dir is specific to user $resultmasssend=''; +if (GETPOST('buttonsendremind')) +{ + $action='presend'; + $mode='sendmassremind'; +} if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers { @@ -122,15 +127,90 @@ if ($action == 'presend' && GETPOST('sendmail')) $nbsent = 0; $nbignored = 0; - for ($i = 0; $i < $countToSend; $i++) + $arrayofinvoices=GETPOST('toSend','array'); + + $thirdparty=new Societe($db); + $invoicetmp=new Facture($db); + $listofinvoicesid=array(); + $listofinvoicesthirdparties=array(); + $listofinvoicesref=array(); + foreach($arrayofinvoices as $invoiceid) { - $object = new Facture($db); - $result = $object->fetch($_POST['toSend'][$i]); - - if ($result > 0) // Invoice was found + $invoicetmp=new Facture($db); // must create new instance because instance is saved into $listofinvoicesref array for future use + $result=$invoicetmp->fetch($invoiceid); + if ($result > 0) + { + $listoinvoicesid[$invoiceid]=$invoiceid; + $thirdpartyid=$invoicetmp->fk_soc?$invoicetmp->fk_soc:$invoicetmp->socid; + $listofinvoicesthirdparties[$thirdpartyid]=$thirdpartyid; + $listofinvoicesref[$thirdpartyid][$invoiceid]=$invoicetmp; + } + } + //var_dump($listofinvoicesref);exit; + + foreach ($listofinvoicesthirdparties as $thirdpartyid) + { + $result = $thirdparty->fetch($thirdpartyid); + if ($result < 0) + { + dol_print_error($db); + exit; + } + + // Define recipient $sendto and $sendtocc + if (trim($_POST['sendto'])) + { + // Recipient is provided into free text + $sendto = trim($_POST['sendto']); + $sendtoid = 0; + } + elseif ($_POST['receiver'] != '-1') { + // Recipient was provided from combo list + if ($_POST['receiver'] == 'thirdparty') // Id of third party + { + $sendto = $thirdparty->email; + $sendtoid = 0; + } + else // Id du contact + { + $sendto = $thirdparty->contact_get_property((int) $_POST['receiver'],'email'); + $sendtoid = $_POST['receiver']; + } + } + if (trim($_POST['sendtocc'])) + { + $sendtocc = trim($_POST['sendtocc']); + } + elseif ($_POST['receivercc'] != '-1') + { + // Recipient was provided from combo list + if ($_POST['receivercc'] == 'thirdparty') // Id of third party + { + $sendtocc = $thirdparty->email; + } + else // Id du contact + { + $sendtocc = $thirdparty->contact_get_property((int) $_POST['receivercc'],'email'); + } + } + + //var_dump($listofinvoicesref[$thirdpartyid]); + + $attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array()); + $listofqualifiedinvoice=array(); + $listofqualifiedref=array(); + foreach($listofinvoicesref[$thirdpartyid] as $invoiceid => $invoice) + { + //var_dump($invoice); + $object = $invoice; + //$object = new Facture($db); + //$result = $object->fetch(); + //var_dump($thirdpartyid.' - '.$invoiceid.' - '.$object->statut); + if ($object->statut != Facture::STATUS_VALIDATED) { + $nbignored++; continue; // Payment done or started or canceled } @@ -144,115 +224,140 @@ if ($action == 'presend' && GETPOST('sendmail')) if (dol_is_file($file)) { - $object->fetch_thirdparty(); - $sendto = $object->thirdparty->email; + if (empty($sendto)) // For the case, no recipient were set (multi thirdparties send) + { + $object->fetch_thirdparty(); + $sendto = $object->thirdparty->email; + } - if (empty($sendto)) $nbignored++; + if (empty($sendto)) + { + $nbignored++; + continue; + } if (dol_strlen($sendto)) { - $langs->load("commercial"); - $from = $user->getFullName($langs) . ' <' . $user->email .'>'; - $replyto = $from; - $subject = GETPOST('subject'); - $message = GETPOST('message'); - $sendtocc = GETPOST('sentocc'); - $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO); - - $substitutionarray=array( - '__ID__' => $object->id, - '__EMAIL__' => $object->thirdparty->email, - '__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj2->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>', - //'__LASTNAME__' => $obj2->lastname, - //'__FIRSTNAME__' => $obj2->firstname, - '__FACREF__' => $object->ref, // For backward compatibility - '__REF__' => $object->ref, - '__REFCLIENT__' => $object->thirdparty->name + // Create form object + $attachedfiles=array( + 'paths'=>array_merge($attachedfiles['paths'],array($file)), + 'names'=>array_merge($attachedfiles['names'],array($filename)), + 'mimes'=>array_merge($attachedfiles['mimes'],array($mime)) ); + } - $subject=make_substitutions($subject, $substitutionarray); - $message=make_substitutions($message, $substitutionarray); + $listofqualifiedinvoice[$invoiceid]=$invoice; + $listofqualifiedref[$invoiceid]=$invoice->ref; + } + else + { + $nbignored++; + $langs->load("other"); + $resultmasssend.='<div class="error">'.$langs->trans('ErrorCantReadFile',$file).'</div>'; + dol_syslog('Failed to read file: '.$file, LOG_WARNING); + continue; + } + + //var_dump($listofqualifiedref); + } - $actiontypecode='AC_FAC'; - $actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; - if ($message) - { - if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); - $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); - $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); - $actionmsg = dol_concatdesc($actionmsg, $message); - } + if (count($listofqualifiedinvoice) > 0) + { + $langs->load("commercial"); + $from = $user->getFullName($langs) . ' <' . $user->email .'>'; + $replyto = $from; + $subject = GETPOST('subject'); + $message = GETPOST('message'); + $sendtocc = GETPOST('sentocc'); + $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO); + + $substitutionarray=array( + '__ID__' => join(', ',array_keys($listofqualifiedinvoice)), + '__EMAIL__' => $thirdparty->email, + '__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>', + //'__LASTNAME__' => $obj2->lastname, + //'__FIRSTNAME__' => $obj2->firstname, + '__FACREF__' => join(', ',$listofqualifiedref), // For backward compatibility + '__REF__' => join(', ',$listofqualifiedref), + '__REFCLIENT__' => $thirdparty->name + ); + + $subject=make_substitutions($subject, $substitutionarray); + $message=make_substitutions($message, $substitutionarray); + + $filepath = $attachedfiles['paths']; + $filename = $attachedfiles['names']; + $mimetype = $attachedfiles['mimes']; + + //var_dump($filepath); + + // Send mail + require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'); + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1); + if ($mailfile->error) + { + $resultmasssend.='<div class="error">'.$mailfile->error.'</div>'; + } + else + { + $result=$mailfile->sendfile(); + if ($result) + { + $resultmasssend.=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); // Must not contain " - // Create form object - $attachedfiles=array('paths'=>array($file), 'names'=>array($filename), 'mimes'=>array($mime)); - $filepath = $attachedfiles['paths']; - $filename = $attachedfiles['names']; - $mimetype = $attachedfiles['mimes']; - - // Send mail - require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'); - $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1); - if ($mailfile->error) - { - $resultmasssend.='<div class="error">'.$mailfile->error.'</div>'; - } - else + $error=0; + + foreach($listofqualifiedinvoice as $invid => $object) { - $result=$mailfile->sendfile(); - if ($result) + $actiontypecode='AC_FAC'; + $actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; + if ($message) { - $resultmasssend.=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); // Must not contain " - - $error=0; - - // Initialisation donnees - $object->sendtoid = 0; - $object->actiontypecode = $actiontypecode; - $object->actionmsg = $actionmsg; // Long text - $object->actionmsg2 = $actionmsg2; // Short text - $object->fk_element = $object->id; - $object->elementtype = $object->element; - - // Appel des triggers - include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); - $interface=new Interfaces($db); - $result=$interface->run_triggers('BILL_SENTBYMAIL',$object,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers - - if (! $error) - { - $resultmasssend.=$langs->trans("MailSent").': '.$sendto."<br>\n"; - } - else - { - dol_print_error($db); - } - $nbsent++; - + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); + } + + // Initialisation donnees + $object->sendtoid = 0; + $object->actiontypecode = $actiontypecode; + $object->actionmsg = $actionmsg; // Long text + $object->actionmsg2 = $actionmsg2; // Short text + $object->fk_element = $invid; + $object->elementtype = $invoice->element; + + // Appel des triggers + include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); + $interface=new Interfaces($db); + $result=$interface->run_triggers('BILL_SENTBYMAIL',$object,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Fin appel triggers + + if (! $error) + { + $resultmasssend.=$langs->trans("MailSent").': '.$sendto."<br>\n"; } else { - $langs->load("other"); - if ($mailfile->error) - { - $resultmasssend.=$langs->trans('ErrorFailedToSendMail',$from,$sendto); - $resultmasssend.='<br><div class="error">'.$mailfile->error.'</div>'; - } - else - { - $resultmasssend.='<div class="warning">No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS</div>'; - } + dol_print_error($db); } + $nbsent++; + } + } + else + { + $langs->load("other"); + if ($mailfile->error) + { + $resultmasssend.=$langs->trans('ErrorFailedToSendMail',$from,$sendto); + $resultmasssend.='<br><div class="error">'.$mailfile->error.'</div>'; + } + else + { + $resultmasssend.='<div class="warning">No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS</div>'; } } - } - else - { - $nbignored++; - $langs->load("other"); - $resultmasssend.='<div class="error">'.$langs->trans('ErrorCantReadFile',$file).'</div>'; - dol_syslog('Failed to read file: '.$file, LOG_WARNING); } } } @@ -417,7 +522,6 @@ $search_societe = GETPOST("search_societe"); $search_paymentmode = GETPOST("search_paymentmode"); $search_montant_ht = GETPOST("search_montant_ht"); $search_montant_ttc = GETPOST("search_montant_ttc"); -$search_status = GETPOST("search_status"); $late = GETPOST("late"); // Do we click on purge search criteria ? @@ -429,7 +533,6 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_paymentmode=''; $search_montant_ht=''; $search_montant_ttc=''; - $search_status=''; } $sortfield = GETPOST("sortfield",'alpha'); @@ -485,7 +588,6 @@ if ($search_paymentmode) $sql .= " AND f.fk_mode_reglement = ".$search_paymentmo if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'"; if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'"; if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'"; -if ($search_status) $sql .= " AND f.fk_statut = ".$search_status; if ($month > 0) { if ($year > 0) @@ -531,7 +633,6 @@ if ($resql) if ($search_societe) $param.='&search_paymentmode='.urlencode($search_paymentmode); if ($search_montant_ht) $param.='&search_montant_ht='.urlencode($search_montant_ht); if ($search_montant_ttc) $param.='&search_montant_ttc='.urlencode($search_montant_ttc); - if ($search_status) $param.='&search_status='.urlencode($search_status); if ($late) $param.='&late='.urlencode($late); if ($mode) $param.='&mode='.urlencode($mode); $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; @@ -551,6 +652,31 @@ if ($resql) print load_fiche_titre($titre,$link); //print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',0); // We don't want pagination on this page + $arrayofinvoices=GETPOST('toSend','array'); + if ($action == 'presend' && count($arrayofinvoices) == 0 && ! GETPOST('cancel')) + { + setEventMessages($langs->trans("InvoiceNotChecked"), null, 'errors'); + $action='list'; + $mode='sendmassremind'; + } + else + { + $invoicetmp=new Facture($db); + $listofinvoicesid=array(); + $listofinvoicesthirdparties=array(); + $listofinvoicesref=array(); + foreach($arrayofinvoices as $invoiceid) + { + $result=$invoicetmp->fetch($invoiceid); + if ($result > 0) + { + $listofinvoicesid[$invoiceid]=$invoiceid; + $thirdpartyid=$invoicetmp->fk_soc?$invoicetmp->fk_soc:$invoicetmp->socid; + $listofinvoicesthirdparties[$thirdpartyid]=$thirdpartyid; + $listofinvoicesref[$thirdpartyid][$invoiceid]=$invoicetmp->ref; + } + } + } print '<form id="form_unpaid" method="POST" action="'.$_SERVER["PHP_SELF"].'?sortfield='. $sortfield .'&sortorder='. $sortorder .'">'; if (GETPOST('modelselected')) { @@ -584,10 +710,25 @@ if ($resql) $formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'inv'.$object->id); } $formmail->withfrom=1; - $liste=array(); - $formmail->withto=$langs->trans("AllRecipientSelectedForRemind"); + $liste=$langs->trans("AllRecipientSelectedForRemind"); + if (count($listofinvoicesthirdparties) == 1) + { + $liste=array(); + $thirdpartyid=array_shift($listofinvoicesthirdparties); + $soc=new Societe($db); + $soc->fetch($thirdpartyid); + foreach ($soc->thirdparty_and_contact_email_array(1) as $key=>$value) + { + $liste[$key]=$value; + } + $formmail->withtoreadonly=0; + } + else + { + $formmail->withtoreadonly=1; + } + $formmail->withto=$liste; $formmail->withtofree=0; - $formmail->withtoreadonly=1; $formmail->withtocc=1; $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; $formmail->withtopic=$langs->transnoentities($topicmail, '__REF__', '__REFCLIENT__'); @@ -606,7 +747,7 @@ if ($resql) $formmail->param['action']=$action; $formmail->param['models']=$modelmail; $formmail->param['models_id']=GETPOST('modelmailselected','int'); - $formmail->param['facid']=$object->id; + $formmail->param['facid']=join(',',$arrayofinvoices); $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; print $formmail->get_form(); @@ -841,7 +982,9 @@ if ($resql) { // Checkbox to send remind print '<td class="nowrap" align="center">'; - if ($objp->email) print '<input class="flat checkforsend" type="checkbox" name="toSend[]" value="'.$objp->facid.'">'; + $selected=0; + if (in_array($objp->facid, $arrayofinvoices)) $selected=1; + if ($objp->email) print '<input class="flat checkforsend" type="checkbox" name="toSend[]" value="'.$objp->facid.'"'.($selected?' checked="checked"':'').'>'; else print img_picto($langs->trans("NoEMail"), 'warning.png'); print '</td>' ; } @@ -888,7 +1031,7 @@ if ($resql) if ($action != 'presend') { print '<div class="tabsAction">'; - print '<a href="'.$_SERVER["PHP_SELF"].'?mode=sendremind&action=presend" class="butAction" name="buttonsendremind" value="'.dol_escape_htmltag($langs->trans("SendRemind")).'">'.$langs->trans("SendRemind").'</a>'; + print '<input type="submit" class="butAction" name="buttonsendremind" value="'.dol_escape_htmltag($langs->trans("SendRemind")).'">'; print '</div>'; print '<br>'; } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 399d148220c05286af2ccbdc98523bb5a7f787c9..909afda913a1f9060cb0acbdd6809b548bb15992 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -830,7 +830,7 @@ class ExtraFields } else { - $sqlwhere.= ' WHERE 1'; + $sqlwhere.= ' WHERE 1=1'; } // Some tables may have field, some other not. For the moment we disable it. if (in_array($InfoFieldList[0],array('tablewithentity'))) @@ -1015,7 +1015,7 @@ class ExtraFields $sqlwhere .= ' WHERE ' . $InfoFieldList[4]; } } else { - $sqlwhere .= ' WHERE 1'; + $sqlwhere .= ' WHERE 1=1'; } // Some tables may have field, some other not. For the moment we disable it. if (in_array($InfoFieldList[0], array ('tablewithentity'))) diff --git a/htdocs/core/filemanagerdol/browser/default/browser.css b/htdocs/core/filemanagerdol/browser/default/browser.css old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/Folder.gif b/htdocs/core/filemanagerdol/browser/default/images/Folder.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/FolderUp.gif b/htdocs/core/filemanagerdol/browser/default/images/FolderUp.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/ai.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/ai.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/avi.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/avi.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/bmp.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/bmp.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/cs.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/cs.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/default.icon.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/default.icon.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/dll.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/dll.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/doc.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/doc.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/exe.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/exe.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/fla.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/fla.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/gif.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/gif.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/htm.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/htm.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/html.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/html.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/jpg.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/jpg.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/js.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/js.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/mdb.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/mdb.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/mp3.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/mp3.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/pdf.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/pdf.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/png.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/png.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/ppt.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/ppt.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/rdp.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/rdp.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/swf.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/swf.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/swt.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/swt.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/txt.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/txt.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/vsd.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/vsd.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/xls.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/xls.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/xml.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/xml.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/zip.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/32/zip.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/ai.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/ai.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/avi.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/avi.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/bmp.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/bmp.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/cs.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/cs.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/default.icon.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/default.icon.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/dll.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/dll.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/doc.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/doc.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/exe.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/exe.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/fla.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/fla.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/gif.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/gif.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/htm.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/htm.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/html.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/html.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/jpg.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/jpg.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/js.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/js.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/mdb.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/mdb.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/mp3.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/mp3.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/pdf.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/pdf.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/png.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/png.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/ppt.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/ppt.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/rdp.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/rdp.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/swf.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/swf.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/swt.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/swt.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/txt.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/txt.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/vsd.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/vsd.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/xls.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/xls.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/xml.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/xml.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/zip.gif b/htdocs/core/filemanagerdol/browser/default/images/icons/zip.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/js/common.js b/htdocs/core/filemanagerdol/browser/default/js/common.js old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/js/fckxml.js b/htdocs/core/filemanagerdol/browser/default/js/fckxml.js old mode 100755 new mode 100644 diff --git a/htdocs/core/filemanagerdol/browser/default/spacer.gif b/htdocs/core/filemanagerdol/browser/default/spacer.gif old mode 100755 new mode 100644 diff --git a/htdocs/core/lib/report.lib.php b/htdocs/core/lib/report.lib.php index 9441482d163ab476e213e79b477ec12d7285af6f..e8cecacf589e607988e91648b6ab09fd132c571e 100644 --- a/htdocs/core/lib/report.lib.php +++ b/htdocs/core/lib/report.lib.php @@ -26,16 +26,16 @@ /** * Show header of a VAT report * -* @param string $nom Name of report +* @param string $nom Name of report * @param string $variante Link for alternate report * @param string $period Period of report * @param string $periodlink Link to switch period * @param string $description Description * @param timestamp|integer $builddate Date generation * @param string $exportlink Link for export or '' -* @param array $moreparam Array with list of params to add into form -* @param string $calcmode Calculation mode -* @param string $varlink Add a variable into the address of the page +* @param array $moreparam Array with list of params to add into form +* @param string $calcmode Calculation mode +* @param string $varlink Add a variable into the address of the page * @return void */ function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='', $varlink='') @@ -45,6 +45,8 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat if (empty($hselected)) $hselected='report'; print "\n\n<!-- debut cartouche rapport -->\n"; + + if(! empty($varlink)) $varlink = '?'.$varlink; if(! empty($varlink)) $varlink = '?'.$varlink; diff --git a/htdocs/core/modules/security/generate/README b/htdocs/core/modules/security/generate/README old mode 100755 new mode 100644 diff --git a/htdocs/includes/fpdfi/README.txt b/htdocs/includes/fpdfi/README.txt old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/colorpicker/jquery.colorpicker.css b/htdocs/includes/jquery/plugins/colorpicker/jquery.colorpicker.css old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/colorpicker/jquery.colorpicker.js b/htdocs/includes/jquery/plugins/colorpicker/jquery.colorpicker.js old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jcrop/css/Jcrop.gif b/htdocs/includes/jquery/plugins/jcrop/css/Jcrop.gif old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jcrop/css/jquery.Jcrop.css b/htdocs/includes/jquery/plugins/jcrop/css/jquery.Jcrop.css old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jcrop/index.html b/htdocs/includes/jquery/plugins/jcrop/index.html old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jcrop/js/jquery.Jcrop.js b/htdocs/includes/jquery/plugins/jcrop/js/jquery.Jcrop.js old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jcrop/js/jquery.Jcrop.min.js b/htdocs/includes/jquery/plugins/jcrop/js/jquery.Jcrop.min.js old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css b/htdocs/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jnotify/jquery.jnotify.css b/htdocs/includes/jquery/plugins/jnotify/jquery.jnotify.css old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/ChangeLog.txt b/htdocs/includes/jquery/plugins/jpicker/ChangeLog.txt old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/Example.html b/htdocs/includes/jquery/plugins/jpicker/Example.html old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/ReadMe.txt b/htdocs/includes/jquery/plugins/jpicker/ReadMe.txt old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/css/jPicker-1.1.6.css b/htdocs/includes/jquery/plugins/jpicker/css/jPicker-1.1.6.css old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/css/jPicker-1.1.6.min.css b/htdocs/includes/jquery/plugins/jpicker/css/jPicker-1.1.6.min.css old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/images/AlphaBar.png b/htdocs/includes/jquery/plugins/jpicker/images/AlphaBar.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/images/Bars.png b/htdocs/includes/jquery/plugins/jpicker/images/Bars.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/images/Maps.png b/htdocs/includes/jquery/plugins/jpicker/images/Maps.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/images/NoColor.png b/htdocs/includes/jquery/plugins/jpicker/images/NoColor.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/images/bar-opacity.png b/htdocs/includes/jquery/plugins/jpicker/images/bar-opacity.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/images/map-opacity.png b/htdocs/includes/jquery/plugins/jpicker/images/map-opacity.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/images/mappoint.gif b/htdocs/includes/jquery/plugins/jpicker/images/mappoint.gif old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/images/picker.gif b/htdocs/includes/jquery/plugins/jpicker/images/picker.gif old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/images/preview-opacity.png b/htdocs/includes/jquery/plugins/jpicker/images/preview-opacity.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/images/rangearrows.gif b/htdocs/includes/jquery/plugins/jpicker/images/rangearrows.gif old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/jPicker.css b/htdocs/includes/jquery/plugins/jpicker/jPicker.css old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/jpicker-1.1.6.js b/htdocs/includes/jquery/plugins/jpicker/jpicker-1.1.6.js old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jpicker/jpicker-1.1.6.min.js b/htdocs/includes/jquery/plugins/jpicker/jpicker-1.1.6.min.js old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/application.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/application.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/code.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/code.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/css.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/css.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/db.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/db.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/directory.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/directory.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/doc.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/doc.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/file.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/file.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/film.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/film.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/flash.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/flash.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/folder_open.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/folder_open.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/html.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/html.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/java.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/java.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/linux.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/linux.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/music.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/music.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/pdf.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/pdf.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/php.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/php.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/picture.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/picture.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/ppt.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/ppt.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/psd.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/psd.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/ruby.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/ruby.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/script.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/script.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/spinner.gif b/htdocs/includes/jquery/plugins/jqueryFileTree/images/spinner.gif old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/txt.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/txt.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/xls.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/xls.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/images/zip.png b/htdocs/includes/jquery/plugins/jqueryFileTree/images/zip.png old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/jqueryFileTree.css b/htdocs/includes/jquery/plugins/jqueryFileTree/jqueryFileTree.css old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/jqueryFileTree.js b/htdocs/includes/jquery/plugins/jqueryFileTree/jqueryFileTree.js old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/tiptip/jquery.tipTip.js b/htdocs/includes/jquery/plugins/tiptip/jquery.tipTip.js old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/tiptip/jquery.tipTip.min.js b/htdocs/includes/jquery/plugins/tiptip/jquery.tipTip.min.js old mode 100755 new mode 100644 diff --git a/htdocs/includes/jquery/plugins/tiptip/tipTip.css b/htdocs/includes/jquery/plugins/tiptip/tipTip.css old mode 100755 new mode 100644 diff --git a/htdocs/install/doctemplates/projects/template_project.odt b/htdocs/install/doctemplates/projects/template_project.odt old mode 100755 new mode 100644 diff --git a/htdocs/install/mysql/data/llx_c_input_method.sql b/htdocs/install/mysql/data/llx_c_input_method.sql old mode 100755 new mode 100644 diff --git a/htdocs/install/mysql/data/llx_c_input_reason.sql b/htdocs/install/mysql/data/llx_c_input_reason.sql old mode 100755 new mode 100644 diff --git a/htdocs/install/mysql/migration/3.0.0-3.1.0.sql b/htdocs/install/mysql/migration/3.0.0-3.1.0.sql old mode 100755 new mode 100644 diff --git a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql old mode 100755 new mode 100644 diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql old mode 100755 new mode 100644 diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql old mode 100755 new mode 100644 diff --git a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql old mode 100755 new mode 100644 diff --git a/htdocs/install/mysql/tables/llx_resource.key.sql b/htdocs/install/mysql/tables/llx_resource.key.sql old mode 100755 new mode 100644 diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index a9451deb151f57ec6a7c00231413905164f3026f..8513bf325f85ad41133014f16ef6057dd58a4bfe 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -113,6 +113,8 @@ BankJournal=Bank journal DescBankJournal=Bank journal including all the types of payments other than cash CashJournal=Cash journal DescCashJournal=Cash journal including the type of payment cash +FinanceJournal=Finance journal +DescFinanceJournal=Finance journal including all the types of payments by bank account CashPayment=Cash Payment diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index c202fa130026a7972258cc2bce9a1936bdcec16a..8a7dfcfe78753c5bda61b8d82208350a9e362652 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -120,4 +120,5 @@ UseTypeFieldToChange=Use field Type to change OpenIDURL=OpenID URL LoginUsingOpenID=Use OpenID to login WeeklyHours=Weekly hours -ColorUser=Color of the user \ No newline at end of file +ColorUser=Color of the user +DisabledInMonoUserMode=Disabled in maintenance mode diff --git a/htdocs/opensurvey/img/accept-24.png b/htdocs/opensurvey/img/accept-24.png old mode 100755 new mode 100644 diff --git a/htdocs/opensurvey/img/accept.png b/htdocs/opensurvey/img/accept.png old mode 100755 new mode 100644 diff --git a/htdocs/opensurvey/img/add-16.png b/htdocs/opensurvey/img/add-16.png old mode 100755 new mode 100644 diff --git a/htdocs/opensurvey/img/add-24.png b/htdocs/opensurvey/img/add-24.png old mode 100755 new mode 100644 diff --git a/htdocs/opensurvey/img/calendar-32.png b/htdocs/opensurvey/img/calendar-32.png old mode 100755 new mode 100644 diff --git a/htdocs/opensurvey/img/cancel.png b/htdocs/opensurvey/img/cancel.png old mode 100755 new mode 100644 diff --git a/htdocs/opensurvey/img/chart-32.png b/htdocs/opensurvey/img/chart-32.png old mode 100755 new mode 100644 diff --git a/htdocs/opensurvey/img/fforward.png b/htdocs/opensurvey/img/fforward.png old mode 100755 new mode 100644 diff --git a/htdocs/opensurvey/img/medaille.png b/htdocs/opensurvey/img/medaille.png old mode 100755 new mode 100644 diff --git a/htdocs/opensurvey/img/next.png b/htdocs/opensurvey/img/next.png old mode 100755 new mode 100644 diff --git a/htdocs/opensurvey/img/object_opensurvey.png b/htdocs/opensurvey/img/object_opensurvey.png old mode 100755 new mode 100644 diff --git a/htdocs/opensurvey/img/previous.png b/htdocs/opensurvey/img/previous.png old mode 100755 new mode 100644 diff --git a/htdocs/opensurvey/img/rewind.png b/htdocs/opensurvey/img/rewind.png old mode 100755 new mode 100644 diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index dcd889a0a77868282e926b312101daab9f6f14ac..a77689949c4fa365cb6b171beed5750f1e83cbec 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -880,8 +880,9 @@ class Product extends CommonObject // Delete all child tables if (! $error) + foreach($elements as $table) { - $elements = array('product_fournisseur_price','product_price','product_lang','categorie_product','product_stock'); + $elements = array('product_fournisseur_price','product_price','product_lang','categorie_product','product_stock','product_customer_price'); foreach($elements as $table) { if (! $error) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 819f1afb67701995ff301f8f959367b9d0e8c7a2..561b38977ac2552c1789301fc004d35da3ef2d09 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -626,17 +626,18 @@ class MouvementStock extends CommonObject return $result; } - /** - * Get origin - * - * @param variant $fk_origin id of origin - * @param int $origintype origin type - * @return string Url link to object - */ - function get_origin($fk_origin, $origintype) + /** + * Return Url link of origin object + * + * @param int $fk_origin Id origin + * @param int $origintype Type origin + * @return string + */ + function get_origin($fk_origin, $origintype) { - switch ($origintype) - { + $origin=''; + + switch ($origintype) { case 'commande': require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $origin = new Commande($this->db); @@ -673,8 +674,11 @@ class MouvementStock extends CommonObject if (empty($origin) || ! is_object($origin)) return ''; - $origin->fetch($fk_origin); - return $origin->getNomUrl(1); + if ($origin->fetch($fk_origin) > 0) { + return $origin->getNomUrl(1); + } + + return ''; } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 0c84826cf474b7fd68f3f013d691207f269783d3..87c65367c93480cb5bba096847dcc1f341ac678e 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2527,7 +2527,7 @@ class Societe extends CommonObject } //Verify duplicate entries - $sql = "SELECT COUNT(*) as idprof FROM ".MAIN_DB_PREFIX."societe WHERE ".$field." = '".$value."'"; + $sql = "SELECT COUNT(*) as idprof FROM ".MAIN_DB_PREFIX."societe WHERE ".$field." = '".$value."' AND entity IN (".getEntity('societe',1).")"; if($socid) $sql .= " AND rowid <> ".$socid; $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/theme/common/mime/readme.txt b/htdocs/theme/common/mime/readme.txt old mode 100755 new mode 100644 diff --git a/htdocs/webservices/demo_wsclient_order.php-NORUN b/htdocs/webservices/demo_wsclient_order.php-NORUN old mode 100755 new mode 100644 diff --git a/test/phpunit/CategorieTest.php b/test/phpunit/CategorieTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/ChargeSocialesTest.php b/test/phpunit/ChargeSocialesTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/CoreTest.php b/test/phpunit/CoreTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/DiscountTest.php b/test/phpunit/DiscountTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/EntrepotTest.php b/test/phpunit/EntrepotTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/Example_import_company_1.csv b/test/phpunit/Example_import_company_1.csv old mode 100755 new mode 100644 diff --git a/test/phpunit/ExportTest.php b/test/phpunit/ExportTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/Functions2LibTest.php b/test/phpunit/Functions2LibTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/ImportTest.php b/test/phpunit/ImportTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/JsonLibTest.php b/test/phpunit/JsonLibTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/LangTest.php b/test/phpunit/LangTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/PdfDocTest.php b/test/phpunit/PdfDocTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/PgsqlTest.php b/test/phpunit/PgsqlTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/ProductTest.php b/test/phpunit/ProductTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/ScriptsTest.php b/test/phpunit/ScriptsTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/SqlTest.php b/test/phpunit/SqlTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/WebservicesOrdersTest.php b/test/phpunit/WebservicesOrdersTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/WebservicesOtherTest.php b/test/phpunit/WebservicesOtherTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/WebservicesUserTest.php b/test/phpunit/WebservicesUserTest.php old mode 100755 new mode 100644