Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop_bug2

This commit is contained in:
Regis Houssin 2020-11-22 09:16:33 +01:00
commit fe5dfab4be
181 changed files with 540 additions and 479 deletions

View File

@ -13,7 +13,7 @@ You can freely use, study, modify or distribute it according to its licence.
You can use it as a standalone application or as a web application to access it from the Internet or a LAN. You can use it as a standalone application or as a web application to access it from the Internet or a LAN.
Dolibarr has a large community ready to help you, free forums and [oficially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org) Dolibarr has a large community ready to help you, free forums and [officially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org)
![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg) ![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg)
@ -45,7 +45,7 @@ On GNU/Linux, first check if your distribution has already packaged Dolibarr.
#### Generic install steps: #### Generic install steps:
- Check that your installed PHP version is supported [see PHP support](https://wiki.dolibarr.org/index.php/Versions). - Check that your installed PHP version is supported [see PHP support](https://wiki.dolibarr.org/index.php/Releases).
- Uncompress the downloaded .zip archive to copy the "dolibarr/htdocs" directory and all its files inside your web server root or get the files directly from GitHub (recommanded if you know git as it makes it easier if you want to upgrade later): - Uncompress the downloaded .zip archive to copy the "dolibarr/htdocs" directory and all its files inside your web server root or get the files directly from GitHub (recommanded if you know git as it makes it easier if you want to upgrade later):
@ -90,6 +90,7 @@ Dolibarr supports upgrading usually wihtout the need for any (commercial) suppor
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file. See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
## FEATURES ## FEATURES
### Main application/modules (all optional) ### Main application/modules (all optional)
@ -162,8 +163,8 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
### System Environment / Requirements ### System Environment / Requirements
- Works with PHP 5.5+ and MariaDB 5.0.3+, MySQL 5.0.3+ or PostgreSQL 8.1.4+ (See requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite)) - Works with PHP 5.6+ and MariaDB 5.0.3+, MySQL 5.0.3+ or PostgreSQL 8.1.4+ (See requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite))
- Compatible with all Cloud solutions that match MySQL, PHP or PostgreSQL prerequisites. - Compatible with all Cloud solutions that match PHP & MySQL or PostgreSQL prerequisites.
### Extending ### Extending

View File

@ -0,0 +1,2 @@
Spain https://incwell.eu/en/company-formation-spain/
France https://www.economie.gouv.fr/entreprises/numeros-identification-entreprise

View File

@ -255,7 +255,7 @@ if ($action == 'create') {
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';
@ -317,7 +317,7 @@ if ($action == 'create') {
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -190,7 +190,7 @@ if ($action == 'create')
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';
@ -241,7 +241,7 @@ if ($action == 'create')
print '</table>'; print '</table>';
print '<br><div class="center">'; print '<br><div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -405,7 +405,7 @@ if ($result)
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
$buttonsave = '<input type="submit" class="button" id="changeaccount" name="changeaccount" value="'.$langs->trans("Save").'">'; $buttonsave = '<input type="submit" class="button button-save" id="changeaccount" name="changeaccount" value="'.$langs->trans("Save").'">';
//print '<br><div class="center">'.$buttonsave.'</div>'; //print '<br><div class="center">'.$buttonsave.'</div>';
$texte = $langs->trans("ListOfProductsServices"); $texte = $langs->trans("ListOfProductsServices");

View File

@ -460,7 +460,7 @@ class AccountingAccount extends CommonObject
$result = ''; $result = '';
$url = ''; $url = ''; $labelurl = '';
if (empty($option) || $option == 'ledger') { if (empty($option) || $option == 'ledger') {
$url = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number); $url = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number);
$labelurl = $langs->trans("ShowAccountingAccountInLedger"); $labelurl = $langs->trans("ShowAccountingAccountInLedger");
@ -617,16 +617,13 @@ class AccountingAccount extends CommonObject
// phpcs:enable // phpcs:enable
$this->db->begin(); $this->db->begin();
if ($mode == 0) $fieldtouse = 'active';
{ if ($mode == 1) {
$fieldtouse = 'active';
} elseif ($mode == 1)
{
$fieldtouse = 'reconcilable'; $fieldtouse = 'reconcilable';
} }
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account "; $sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account";
$sql .= "SET ".$fieldtouse." = '1'"; $sql .= " SET ".$fieldtouse." = '1'";
$sql .= " WHERE rowid = ".$this->db->escape($id); $sql .= " WHERE rowid = ".$this->db->escape($id);
dol_syslog(get_class($this)."::account_activate ".$fieldtouse." sql=".$sql, LOG_DEBUG); dol_syslog(get_class($this)."::account_activate ".$fieldtouse." sql=".$sql, LOG_DEBUG);

View File

@ -140,7 +140,7 @@ if (!empty($id)) {
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -149,7 +149,7 @@ if (!empty($id)) {
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -144,7 +144,7 @@ if (!empty($id)) {
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -134,7 +134,7 @@ echo $this->control->tpl['ajax_selectcountry'];
<tr> <tr>
<td colspan="4" class="center"> <td colspan="4" class="center">
<input type="submit" class="button" name="save" value="<?php echo $langs->trans("Save"); ?>">&nbsp; <input type="submit" class="button button-save" name="save" value="<?php echo $langs->trans("Save"); ?>">&nbsp;
<input type="submit" class="button" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>"> <input type="submit" class="button" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>">
</td> </td>
</tr> </tr>

View File

@ -1235,7 +1235,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -236,7 +236,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') {
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="submit" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" name="submit" value="'.$langs->trans("Save").'">';
print ' &nbsp; &nbsp; &nbsp; '; print ' &nbsp; &nbsp; &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -765,7 +765,7 @@ if ($rowid > 0) {
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -218,7 +218,7 @@ if ($action == 'edit') {
print '<br>'; print '<br>';
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';
@ -275,7 +275,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) {
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -170,7 +170,7 @@ print '</td></tr>';
print '</table>'; print '</table>';
print '<br><div class="center">'; print '<br><div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
//print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; //print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
//print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; //print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -200,7 +200,7 @@ print '</div>';
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" name="save" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" name="save" class="button button-save" value="'.$langs->trans("Save").'">';
print "</div>"; print "</div>";
print "</form>\n"; print "</form>\n";

View File

@ -227,7 +227,7 @@ print '</table>';
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" id="save" name="save" class="button hideifnotset" value="'.$langs->trans("Save").'">'; print '<input type="submit" id="save" name="save" class="button hideifnotset button-save" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print "</form>\n"; print "</form>\n";

View File

@ -378,7 +378,7 @@ print '</table>';
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input class="button" type="submit" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>'; print '<div class="center"><input class="button button-save" type="submit" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
print '</form>'; print '</form>';

View File

@ -25,6 +25,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
require_once DOL_DOCUMENT_ROOT.'/cron/class/cronjob.class.php';
if (!$user->admin) if (!$user->admin)
accessforbidden(); accessforbidden();
@ -179,59 +180,75 @@ print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'.$langs->trans("Value").'</td>'."\n"; print '<td class="right">'.$langs->trans("Value").'</td>'."\n";
print '</tr>'."\n"; print '</tr>'."\n";
// AGENDA REMINDER BROWSER
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans('AGENDA_REMINDER_BROWSER').'</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n";
if (empty($conf->global->AGENDA_REMINDER_BROWSER)) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_REMINDER_BROWSER&amp;token='.newToken().'">'.img_picto($langs->trans('Disabled'), 'switch_off').'</a>';
print '</td></tr>'."\n";
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_REMINDER_BROWSER&amp;token='.newToken().'">'.img_picto($langs->trans('Enabled'), 'switch_on').'</a>';
print '</td></tr>'."\n";
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans('AGENDA_REMINDER_BROWSER_SOUND').'</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n";
if (empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_REMINDER_BROWSER_SOUND&amp;token='.newToken().'">'.img_picto($langs->trans('Disabled'), 'switch_off').'</a>';
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_REMINDER_BROWSER_SOUND&amp;token='.newToken().'">'.img_picto($langs->trans('Enabled'), 'switch_on').'</a>';
}
print '</td></tr>'."\n";
}
$job = new Cronjob($db);
$job->fetch(0, 'ActionComm', 'sendEmailsReminder');
// AGENDA REMINDER EMAIL // AGENDA REMINDER EMAIL
if ($conf->global->MAIN_FEATURES_LEVEL == 2) print '<tr class="oddeven">'."\n";
{ print '<td>'.$langs->trans('AGENDA_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"));
print '<tr class="oddeven">'."\n"; if (!empty($conf->cron->enabled)) {
print '<td>'.$langs->trans('AGENDA_REMINDER_EMAIL', $langs->transnoentities("Module2300Name")).'</td>'."\n"; if (!empty($conf->global->AGENDA_REMINDER_EMAIL)) {
print '<td class="center">&nbsp;</td>'."\n"; if ($job->id > 0) {
print '<td class="right">'."\n"; if ($job->status == $job::STATUS_ENABLED) {
print '<br><span class="opacitymedium">'.$langs->trans("AGENDA_REMINDER_EMAIL_NOTE", $langs->transnoentitiesnoconv("sendEmailsReminder")).'</span>';
}
}
}
}
print '</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n";
if (empty($conf->cron->enabled)) {
print '<span class="opacitymedium">'.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Module2300Name")).'</span>';
} else {
if (empty($conf->global->AGENDA_REMINDER_EMAIL)) { if (empty($conf->global->AGENDA_REMINDER_EMAIL)) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_REMINDER_EMAIL&amp;token='.newToken().'">'.img_picto($langs->trans('Disabled'), 'switch_off').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_REMINDER_EMAIL&amp;token='.newToken().'">'.img_picto($langs->trans('Disabled'), 'switch_off').'</a>';
print '</td></tr>'."\n";
} else { } else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_REMINDER_EMAIL&amp;token='.newToken().'">'.img_picto($langs->trans('Enabled'), 'switch_on').'</a>'; // Get the max frequency of reminder
print '</td></tr>'."\n"; if ($job->id > 0) {
} if ($job->status != $job::STATUS_ENABLED) {
} print '<span class="opacitymedium warning">'.$langs->trans("JobXMustBeEnabled", $langs->transnoentitiesnoconv("sendEmailsReminder")).'</span>';
} else {
// AGENDA REMINDER BROWSER print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_REMINDER_EMAIL&amp;token='.newToken().'">'.img_picto($langs->trans('Enabled'), 'switch_on').'</a>';
if ($conf->global->MAIN_FEATURES_LEVEL == 2) }
{
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans('AGENDA_REMINDER_BROWSER').'</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n";
if (empty($conf->global->AGENDA_REMINDER_BROWSER)) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_REMINDER_BROWSER&amp;token='.newToken().'">'.img_picto($langs->trans('Disabled'), 'switch_off').'</a>';
print '</td></tr>'."\n";
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_REMINDER_BROWSER&amp;token='.newToken().'">'.img_picto($langs->trans('Enabled'), 'switch_on').'</a>';
print '</td></tr>'."\n";
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans('AGENDA_REMINDER_BROWSER_SOUND').'</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n";
if (empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_REMINDER_BROWSER_SOUND&amp;token='.newToken().'">'.img_picto($langs->trans('Disabled'), 'switch_off').'</a>';
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_REMINDER_BROWSER_SOUND&amp;token='.newToken().'">'.img_picto($langs->trans('Enabled'), 'switch_on').'</a>';
} }
print '</td></tr>'."\n";
} }
} }
print '</td></tr>'."\n";
print '</table>'; print '</table>';
print dol_get_fiche_end(); print dol_get_fiche_end();
//print '<div class="center"><input class="button" type="submit" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>'; //print '<div class="center"><input class="button button-save" type="submit" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
print '</form>'; print '</form>';

View File

@ -138,7 +138,7 @@ print '</table>';
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">"; print '<input type="submit" name="save" class="button button-save" value="'.$langs->trans("Save").'">';
print "</div>"; print "</div>";
print "</form>\n"; print "</form>\n";

View File

@ -498,7 +498,7 @@ print '</table>';
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" id="save" name="save" class="button hideifnotset" value="'.$langs->trans("Save").'">'; print '<input type="submit" id="save" name="save" class="button hideifnotset button-save" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print "</form>\n"; print "</form>\n";

View File

@ -282,7 +282,7 @@ print "</table>\n";
if (empty($conf->use_javascript_ajax)) if (empty($conf->use_javascript_ajax))
{ {
print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"></div>'; print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'"></div>';
print '</form>'; print '</form>';
} }

View File

@ -474,7 +474,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL == 2 || !empty($conf->global->MAIN_ACTIVA
print '</table>'; print '</table>';
print '<br>'; print '<br>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'" name="Button"></div>'; print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'" name="Button"></div>';
print '<br>'; print '<br>';
print '</form>'; print '</form>';

View File

@ -834,7 +834,7 @@ print "</table>";
print '<br><div class="center">'; print '<br><div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';

View File

@ -483,7 +483,7 @@ print '</tr>';
print '</table>'; print '</table>';
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';

View File

@ -108,7 +108,7 @@ if ($action == 'edit')
print '</table>'; print '</table>';
print '<br><div class="center">'; print '<br><div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';
@ -151,7 +151,7 @@ if ($action == 'edit')
print dol_get_fiche_end(); print dol_get_fiche_end();
/*print '<div class="center">'; /*print '<div class="center">';
print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">"; print '<input type="submit" name="save" class="button button-save" value="'.$langs->trans("Save").'">';
print "</div>"; print "</div>";
*/ */
print "</form>\n"; print "</form>\n";

View File

@ -432,7 +432,7 @@ if ($conf->global->MAIN_DISABLE_METEO != 1) {
if ($action == 'edit') { if ($action == 'edit') {
print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>'; print '<br><div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
print '<br></form>'; print '<br></form>';
} else { } else {
print '<br><div class="tabsAction">'; print '<br><div class="tabsAction">';

View File

@ -297,7 +297,7 @@ if (($id || $ref) && $action == 'edit')
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print ' &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';
@ -614,7 +614,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{ {
print '<input type="text" class="quatrevingtquinzepercent" name="operationparam2" value="'.$ruleaction['actionparam'].'"><br>'; print '<input type="text" class="quatrevingtquinzepercent" name="operationparam2" value="'.$ruleaction['actionparam'].'"><br>';
print '<input type="hidden" name="rowidoperation2" value="'.$ruleaction['id'].'"><br>'; print '<input type="hidden" name="rowidoperation2" value="'.$ruleaction['id'].'"><br>';
print '<input type="submit" class="button" name="saveoperation2" value="'.$langs->trans("Save").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button button-save" name="saveoperation2" value="'.$langs->trans("Save").'">';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
} else { } else {
print $ruleaction['actionparam']; print $ruleaction['actionparam'];
} }

View File

@ -128,7 +128,7 @@ print '</table>';
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">"; print '<input type="submit" name="save" class="button button-save" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print "</form>\n"; print "</form>\n";

View File

@ -475,7 +475,7 @@ print '</td></tr>'."\n";
print '</table>'; print '</table>';
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';

View File

@ -155,7 +155,7 @@ function _updateBtn()
{ {
global $langs; global $langs;
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
} }

View File

@ -211,7 +211,7 @@ if (empty($conf->use_javascript_ajax))
print $conf->global->FCKEDITOR_TEST; print $conf->global->FCKEDITOR_TEST;
print '</div>'; print '</div>';
} }
print '<br><div class="center"><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"></div>'."\n"; print '<br><div class="center"><input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'"></div>'."\n";
print '<div id="divforlog"></div>'; print '<div id="divforlog"></div>';
print '</form>'."\n"; print '</form>'."\n";

View File

@ -494,7 +494,7 @@ print '</div>';
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';

View File

@ -249,7 +249,7 @@ print '</tr>';
// Default language // Default language
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultLanguage").'</td><td>'; print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultLanguage").'</td><td>';
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2); print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2);
print '<input class="button" type="submit" name="submit" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" name="submit" value="'.$langs->trans("Save").'">';
print '</td>'; print '</td>';
print '<td width="20">&nbsp;</td>'; print '<td width="20">&nbsp;</td>';
print '</tr>'; print '</tr>';
@ -443,7 +443,7 @@ print '</div>';
print '<br>'; print '<br>';
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" name="submit" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" name="submit" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';

View File

@ -165,7 +165,7 @@ if ($action == 'edit')
print '<br>'; print '<br>';
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '<br>'; print '<br>';

View File

@ -509,7 +509,7 @@ if ($action == 'edit')
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<br><div class="center">'; print '<br><div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -387,7 +387,7 @@ if ($action == 'edit')
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<br><div class="center">'; print '<br><div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -381,7 +381,7 @@ if ($action != 'create') {
print '</table>'; print '</table>';
print '<br>'; print '<br>';
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; '; print ' &nbsp; ';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';
@ -414,7 +414,7 @@ if ($action != 'create') {
print '</table>'; print '</table>';
print '<br>'; print '<br>';
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; '; print ' &nbsp; ';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -364,7 +364,7 @@ if ($action == 'edit')
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<br><div class="center">'; print '<br><div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -209,7 +209,7 @@ print '</table>';
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';

View File

@ -401,7 +401,7 @@ if ($action == 'create')
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';
@ -511,7 +511,7 @@ if ($action == 'create')
// Bouton // Bouton
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -203,7 +203,7 @@ print '</td>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>'; print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
print '</form>'; print '</form>';
@ -292,7 +292,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
print '</table>'; print '</table>';
} }
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>'; print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
print '</form>'; print '</form>';
@ -389,7 +389,7 @@ print '</div>';
print '<br>'; print '<br>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>'; print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
print '</form>'; print '</form>';

View File

@ -130,7 +130,7 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit')
print '</table>'; print '</table>';
print '<br><div class="center">'; print '<br><div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '<br>'; print '<br>';

View File

@ -192,7 +192,7 @@ print '</td></tr>';
print '</table>'; print '</table>';
print '<br>'; print '<br>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>'; print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
print '</form>'; print '</form>';

View File

@ -336,7 +336,7 @@ print '</table>';
print '</div>'; print '</div>';
print '<br><div class="center">'; print '<br><div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';

View File

@ -199,7 +199,7 @@ print '</td></tr>';
print '</table>'; print '</table>';
print '<br>'; print '<br>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>'; print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
print '</form>'; print '</form>';

View File

@ -327,7 +327,7 @@ if ($mode == 'config' && $user->admin) {
print '<td>'.$printer->profileresprint.'</td>'; print '<td>'.$printer->profileresprint.'</td>';
print '<td><input size="60" type="text" name="parameter" value="'.$printer->listprinters[$line]['parameter'].'"></td>'; print '<td><input size="60" type="text" name="parameter" value="'.$printer->listprinters[$line]['parameter'].'"></td>';
print '<td>'; print '<td>';
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>'; print '<div class="center"><input type="submit" class="button button-save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} else { } else {
@ -456,7 +456,7 @@ if ($mode == 'template' && $user->admin) {
print '<input type="hidden" name="templateid" value="'.$printer->listprinterstemplates[$line]['rowid'].'">'; print '<input type="hidden" name="templateid" value="'.$printer->listprinterstemplates[$line]['rowid'].'">';
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'"></div>'; print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'"></div>';
} else { } else {
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>'; print '<div class="center"><input type="submit" class="button button-save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
} }
print '</form>'; print '</form>';

View File

@ -323,7 +323,7 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso") {
print '<br>'; print '<br>';
print '<div class="center">'; print '<div class="center">';
print '<a class="button" id="linkChangePattern">'.$langs->trans("Save").'</a>'; print '<a class="button button-save" id="linkChangePattern">'.$langs->trans("Save").'</a>';
print '</div>'; print '</div>';
print '<br><br>'; print '<br><br>';

View File

@ -196,7 +196,7 @@ if ($action == 'edit')
print '</table>'; print '</table>';
print '<br><div class="center">'; print '<br><div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"'.(!count($listofmethods) ? ' disabled' : '').'>'; print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'"'.(!count($listofmethods) ? ' disabled' : '').'>';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -225,7 +225,7 @@ print '<tr class="oddeven"><td>'.$langs->trans("CurrentTimeZone").'</td><td>'; /
$a = getServerTimeZoneInt('now'); $a = getServerTimeZoneInt('now');
$b = getServerTimeZoneInt('winter'); $b = getServerTimeZoneInt('winter');
$c = getServerTimeZoneInt('summer'); $c = getServerTimeZoneInt('summer');
$daylight = (is_numeric($c) && is_numeric($b)) ?round($c - $b) : 'unknown'; $daylight = round($c - $b);
//print $a." ".$b." ".$c." ".$daylight; //print $a." ".$b." ".$c." ".$daylight;
$val = ($a >= 0 ? '+' : '').$a; $val = ($a >= 0 ? '+' : '').$a;
$val .= ' ('.($a == 'unknown' ? 'unknown' : ($a >= 0 ? '+' : '').($a * 3600)).')'; $val .= ' ('.($a == 'unknown' ? 'unknown' : ($a >= 0 ? '+' : '').($a * 3600)).')';

View File

@ -410,7 +410,7 @@ print '</td></tr>';
print '</table>'; print '</table>';
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';

View File

@ -280,7 +280,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
} }
if (!$conf->use_javascript_ajax) { if (!$conf->use_javascript_ajax) {
print '<tr class="impair"><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td>'; print '<tr class="impair"><td colspan="3" align="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></td>';
print '</tr>'; print '</tr>';
} }
@ -410,7 +410,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
print '</table>'; print '</table>';
print '</div>'; print '</div>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>'; print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
print '</form>'; print '</form>';
} }

View File

@ -344,7 +344,7 @@ if ($mode == 'overwrite')
if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int')) if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int'))
{ {
print '<input type="hidden" class="button" name="rowid" value="'.$obj->rowid.'">'; print '<input type="hidden" class="button" name="rowid" value="'.$obj->rowid.'">';
print '<input type="submit" class="button buttongen" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'">'; print '<input type="submit" class="button buttongen button-save" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
print ' &nbsp; '; print ' &nbsp; ';
print '<input type="submit" class="button buttongen" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">'; print '<input type="submit" class="button buttongen" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
} else { } else {

View File

@ -116,7 +116,7 @@ if ($action == 'edit')
print '</table>'; print '</table>';
print '<br><div class="center">'; print '<br><div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';

View File

@ -129,7 +129,7 @@ print ' '.$langs->trans("Example").': '.$langs->trans("IPListExample");
print '</td>'; print '</td>';
print '<td><input type="text" name="API_RESTRICT_ON_IP" value="'.dol_escape_htmltag($conf->global->API_RESTRICT_ON_IP).'"></td>'; print '<td><input type="text" name="API_RESTRICT_ON_IP" value="'.dol_escape_htmltag($conf->global->API_RESTRICT_ON_IP).'"></td>';
print '<td>'; print '<td>';
print '<input type="submit" class="button" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></td>'; print '<input type="submit" class="button button-save" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></td>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -82,7 +82,7 @@ if ($action == 'edit')
print '</table>'; print '</table>';
print '<br><div class="center">'; print '<br><div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';

View File

@ -220,7 +220,7 @@ if (($id || $ref) && $action == 'edit')
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print ' &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -597,7 +597,7 @@ if ($rowid > 0)
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print ' &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -313,7 +313,7 @@ if (($id || $ref) && $action == 'edit')
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print ' &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -135,7 +135,7 @@ print '</td>';
$coldisplay += $colspan; $coldisplay += $colspan;
print '<td class="nobottom linecoledit center valignmiddle" colspan="'.$colspan.'">'; print '<td class="nobottom linecoledit center valignmiddle" colspan="'.$colspan.'">';
$coldisplay += $colspan; $coldisplay += $colspan;
print '<input type="submit" class="button buttongen marginbottomonly" id="savelinebutton marginbottomonly" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button buttongen marginbottomonly button-save" id="savelinebutton marginbottomonly" name="save" value="'.$langs->trans("Save").'">';
print '<br>'; print '<br>';
print '<input type="submit" class="button buttongen marginbottomonly" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button buttongen marginbottomonly" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</td>'; print '</td>';

View File

@ -299,7 +299,7 @@ if ($id > 0 && !preg_match('/^add/i', $action))
if ($action == 'edit') if ($action == 'edit')
{ {
print '<div align="center"><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; <input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; print '<div align="center"><input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; <input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
print '</form>'; print '</form>';
} }

View File

@ -184,7 +184,7 @@ if (!empty($conf->receiptprinter->enabled))
print '</table>'; print '</table>';
print '<br>'; print '<br>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>'; print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
print "</form>\n"; print "</form>\n";

View File

@ -285,7 +285,7 @@ if ($action == 'edit')
print '<br>'; print '<br>';
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';
@ -346,7 +346,7 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service
print '</table>'; print '</table>';
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -117,8 +117,8 @@ $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
$TRemindTypes = array(); $TRemindTypes = array();
if (!empty($conf->global->AGENDA_REMINDER_EMAIL)) $TRemindTypes['email'] = $langs->trans('EMail'); if (!empty($conf->global->AGENDA_REMINDER_BROWSER)) $TRemindTypes['browser'] = array('label'=>$langs->trans('BrowserPush'), 'disabled'=>(empty($conf->global->AGENDA_REMINDER_BROWSER) ? 1 : 0));
if (!empty($conf->global->AGENDA_REMINDER_BROWSER)) $TRemindTypes['browser'] = $langs->trans('BrowserPush'); if (!empty($conf->global->AGENDA_REMINDER_EMAIL)) $TRemindTypes['email'] = array('label'=>$langs->trans('EMail'), 'disabled'=>(empty($conf->global->AGENDA_REMINDER_EMAIL) ? 1 : 0));
$TDurationTypes = array('y'=>$langs->trans('Years'), 'm'=>$langs->trans('Month'), 'w'=>$langs->trans('Weeks'), 'd'=>$langs->trans('Days'), 'h'=>$langs->trans('Hours'), 'i'=>$langs->trans('Minutes')); $TDurationTypes = array('y'=>$langs->trans('Years'), 'm'=>$langs->trans('Month'), 'w'=>$langs->trans('Weeks'), 'd'=>$langs->trans('Days'), 'h'=>$langs->trans('Hours'), 'i'=>$langs->trans('Minutes'));
@ -503,7 +503,6 @@ if (empty($reshook) && $action == 'update')
$object->note_private = trim(GETPOST("note", "restricthtml")); $object->note_private = trim(GETPOST("note", "restricthtml"));
$object->fk_element = GETPOST("fk_element", "int"); $object->fk_element = GETPOST("fk_element", "int");
$object->elementtype = GETPOST("elementtype", "alphanohtml"); $object->elementtype = GETPOST("elementtype", "alphanohtml");
if (!$datef && $percentage == 100) if (!$datef && $percentage == 100)
{ {
$error++; $donotclearsession = 1; $error++; $donotclearsession = 1;
@ -1247,12 +1246,7 @@ if ($action == 'create')
//Reminder //Reminder
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ReminderTime").'</td><td colspan="3">'; print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ReminderTime").'</td><td colspan="3">';
print '<input type="number" name="offsetvalue" value="10" size="5">'; print '<input class="width50" type="number" name="offsetvalue" value="'.(GETPOSTISSET('offsetvalue') ? GETPOST('offsetvalue', 'int') : '15').'"> '.$form->selectTypeDuration('offsetunit', 'i');
print '</td></tr>';
//Time Type
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("TimeType").'</td><td colspan="3">';
print $form->selectTypeDuration('offsetunit', 'i');
print '</td></tr>'; print '</td></tr>';
//Reminder Type //Reminder Type
@ -1731,20 +1725,13 @@ if ($id > 0)
print '<table class="border centpercent">'; print '<table class="border centpercent">';
//Reminder // Reminder
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ReminderTime").'</td><td colspan="3">'; print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ReminderTime").'</td><td colspan="3">';
print '<input type="number" name="offsetvalue" value="'.$actionCommReminder->offsetvalue.'" size="5">'; print '<input type="number" name="offsetvalue" class="width50" value="'.$actionCommReminder->offsetvalue.'"> '.$form->selectTypeDuration('offsetunit', $actionCommReminder->offsetunit);
print '</td></tr>'; print '</td></tr>';
//Time Type // Reminder Type
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("TimeType").'</td><td colspan="3">';
print $form->selectTypeDuration('offsetunit', $actionCommReminder->offsetunit);
print '</td></tr>';
//Reminder Type
$TRemindTypes = array(); $TRemindTypes = array();
if (!empty($conf->global->AGENDA_REMINDER_EMAIL)) $TRemindTypes['email'] = $langs->trans('EMail');
if (!empty($conf->global->AGENDA_REMINDER_BROWSER)) $TRemindTypes['browser'] = $langs->trans('BrowserPush');
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ReminderType").'</td><td colspan="3">'; print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ReminderType").'</td><td colspan="3">';
print $form->selectarray('selectremindertype', $TRemindTypes, $actionCommReminder->typeremind); print $form->selectarray('selectremindertype', $TRemindTypes, $actionCommReminder->typeremind);
print '</td></tr>'; print '</td></tr>';
@ -1752,7 +1739,7 @@ if ($id > 0)
$hide = ''; $hide = '';
if ($actionCommReminder->typeremind == 'browser') $hide = 'style="display:none;"'; if ($actionCommReminder->typeremind == 'browser') $hide = 'style="display:none;"';
//Mail Model // Mail Model
print '<tr '.$hide.'><td class="titlefieldcreate nowrap">'.$langs->trans("EMailTemplates").'</td><td colspan="3">'; print '<tr '.$hide.'><td class="titlefieldcreate nowrap">'.$langs->trans("EMailTemplates").'</td><td colspan="3">';
print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1); print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1);
print '</td></tr>'; print '</td></tr>';
@ -1785,7 +1772,7 @@ if ($id > 0)
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="edit" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" name="edit" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -1000,7 +1000,7 @@ class ActionComm extends CommonObject
// Clean parameters // Clean parameters
$this->label = trim($this->label); $this->label = trim($this->label);
$this->note_private = dol_htmlcleanlastbr(trim(empty($this->note_private) ? $this->note : $this->note_private)); $this->note_private = dol_htmlcleanlastbr(trim(!isset($this->note_private) ? $this->note : $this->note_private));
if (empty($this->percentage)) $this->percentage = 0; if (empty($this->percentage)) $this->percentage = 0;
if (empty($this->priority) || !is_numeric($this->priority)) $this->priority = 0; if (empty($this->priority) || !is_numeric($this->priority)) $this->priority = 0;
if (empty($this->transparency)) $this->transparency = 0; if (empty($this->transparency)) $this->transparency = 0;
@ -1206,16 +1206,17 @@ class ActionComm extends CommonObject
* Load indicators for dashboard (this->nbtodo and this->nbtodolate) * Load indicators for dashboard (this->nbtodo and this->nbtodolate)
* *
* @param User $user Objet user * @param User $user Objet user
* @param int $load_state_board Charge indicateurs this->nb de tableau de bord * @param int $load_state_board Load indicator array this->nb
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/ */
public function load_board($user, $load_state_board = 0) public function load_board($user, $load_state_board = 0)
{ {
// phpcs:enable // phpcs:enable
global $conf, $langs; global $conf, $langs;
if (empty($load_state_board)) $sql = "SELECT a.id, a.datep as dp"; if (empty($load_state_board)) {
else { $sql = "SELECT a.id, a.datep as dp";
} else {
$this->nb = array(); $this->nb = array();
$sql = "SELECT count(a.id) as nb"; $sql = "SELECT count(a.id) as nb";
} }
@ -1243,13 +1244,14 @@ class ActionComm extends CommonObject
$response->img = img_object('', "action", 'class="inline-block valigntextmiddle"'); $response->img = img_object('', "action", 'class="inline-block valigntextmiddle"');
} }
// This assignment in condition is not a bug. It allows walking the results. // This assignment in condition is not a bug. It allows walking the results.
while ($obj = $this->db->fetch_object($resql)) while ($obj = $this->db->fetch_object($resql)) {
{
if (empty($load_state_board)) { if (empty($load_state_board)) {
$response->nbtodo++; $response->nbtodo++;
$agenda_static->datep = $this->db->jdate($obj->dp); $agenda_static->datep = $this->db->jdate($obj->dp);
if ($agenda_static->hasDelay()) $response->nbtodolate++; if ($agenda_static->hasDelay()) $response->nbtodolate++;
} else $this->nb["actionscomm"] = $obj->nb; } else {
$this->nb["actionscomm"] = $obj->nb;
}
} }
$this->db->free($resql); $this->db->free($resql);
@ -2085,6 +2087,7 @@ class ActionComm extends CommonObject
if ($res > 0) if ($res > 0)
{ {
// PREPARE EMAIL // PREPARE EMAIL
$errormesg = '';
// Make substitution in email content // Make substitution in email content
$substitutionarray = getCommonSubstitutionArray($langs, 0, '', $this); $substitutionarray = getCommonSubstitutionArray($langs, 0, '', $this);
@ -2100,43 +2103,65 @@ class ActionComm extends CommonObject
// Recipient // Recipient
$recipient = new User($this->db); $recipient = new User($this->db);
$res = $recipient->fetch($actionCommReminder->fk_user); $res = $recipient->fetch($actionCommReminder->fk_user);
if ($res > 0 && !empty($recipient->email)) $to = $recipient->email; if ($res > 0) {
else { if (!empty($recipient->email)) {
$errorsMsg[] = "Failed to load recipient"; $to = $recipient->email;
} else {
$errormesg = "Failed to send remind to user id=".$actionCommReminder->fk_user.". No email defined for user.";
$error++;
}
} else {
$errormesg = "Failed to load recipient with user id=".$actionCommReminder->fk_user;
$error++; $error++;
} }
// Sender // Sender
$from = $conf->global->MAIN_MAIL_EMAIL_FROM; $from = $conf->global->MAIN_MAIL_EMAIL_FROM;
if (empty($from)) { if (empty($from)) {
$errorsMsg[] = "Failed to load recipient"; $errormesg = "Failed to get sender into global setup MAIN_MAIL_EMAIL_FROM";
$error++; $error++;
} }
// Errors Recipient if (!$error) {
$errors_to = $conf->global->MAIN_MAIL_ERRORS_TO; // Errors Recipient
$errors_to = $conf->global->MAIN_MAIL_ERRORS_TO;
// Mail Creation // Mail Creation
$cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, array(), array(), array(), '', "", 0, 1, $errors_to, '', '', '', '', ''); $cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, array(), array(), array(), '', "", 0, 1, $errors_to, '', '', '', '', '');
// Sending Mail // Sending Mail
if ($cMailFile->sendfile()) if ($cMailFile->sendfile()) {
{ $nbMailSend++;
} else {
$errormesg = $cMailFile->error.' : '.$to;
$error++;
}
}
if (!$error) {
$actionCommReminder->status = $actionCommReminder::STATUS_DONE; $actionCommReminder->status = $actionCommReminder::STATUS_DONE;
$res = $actionCommReminder->update($user); $res = $actionCommReminder->update($user);
if ($res < 0) if ($res < 0) {
{ $errorsMsg[] = "Failed to update status to done of ActionComm Reminder";
$errorsMsg[] = "Failed to update status of ActionComm Reminder"; $error++;
break; // This is to avoid to have this error on all the selected email. If we fails here for one record, it may fails for others. We must solve first.
}
} else {
$actionCommReminder->status = $actionCommReminder::STATUS_ERROR;
$actionCommReminder->lasterror = dol_trunc($errormesg, 128, 'right', 'UTF-8', 1);
$res = $actionCommReminder->update($user);
if ($res < 0) {
$errorsMsg[] = "Failed to update status to error of ActionComm Reminder";
$error++; $error++;
break; // This is to avoid to have this error on all the selected email. If we fails here for one record, it may fails for others. We must solve first. break; // This is to avoid to have this error on all the selected email. If we fails here for one record, it may fails for others. We must solve first.
} else { } else {
$nbMailSend++; $errorsMsg[] = $errormesg;
} }
} else {
$errorsMsg[] = $cMailFile->error.' : '.$to;
$error++;
} }
} else { } else {
$errorsMsg[] = 'Failed to fetch record actioncomm with ID = '.$actionCommReminder->fk_actioncomm;
$error++; $error++;
} }
} }
@ -2150,6 +2175,7 @@ class ActionComm extends CommonObject
// Delete also very old past events (we do not keep more than 1 month record in past) // Delete also very old past events (we do not keep more than 1 month record in past)
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_reminder"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_reminder";
$sql .= " WHERE dateremind < '".$this->db->idate($now - (3600 * 24 * 32))."'"; $sql .= " WHERE dateremind < '".$this->db->idate($now - (3600 * 24 * 32))."'";
$sql .= " AND status = ".$actionCommReminder::STATUS_DONE;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (!$resql) { if (!$resql) {
@ -2164,7 +2190,7 @@ class ActionComm extends CommonObject
return 0; return 0;
} }
else { else {
$this->db->rollback(); $this->db->commit(); // We commit also on error, to have the error message recorded.
$this->error = 'Nb of emails sent : '.$nbMailSend.', '.(!empty($errorsMsg)) ? join(', ', $errorsMsg) : $error; $this->error = 'Nb of emails sent : '.$nbMailSend.', '.(!empty($errorsMsg)) ? join(', ', $errorsMsg) : $error;
return $error; return $error;
} }

View File

@ -52,6 +52,7 @@ class ActionCommReminder extends CommonObject
const STATUS_TODO = 0; const STATUS_TODO = 0;
const STATUS_DONE = 1; const STATUS_DONE = 1;
const STATUS_ERROR = -1;
/** /**
@ -84,8 +85,9 @@ class ActionCommReminder extends CommonObject
'offsetvalue' => array('type'=>'integer', 'label'=>'OffsetValue', 'visible'=>1, 'enabled'=>1, 'position'=>56, 'notnull'=>1,), 'offsetvalue' => array('type'=>'integer', 'label'=>'OffsetValue', 'visible'=>1, 'enabled'=>1, 'position'=>56, 'notnull'=>1,),
'offsetunit' => array('type'=>'varchar(1)', 'label'=>'OffsetUnit', 'visible'=>1, 'enabled'=>1, 'position'=>57, 'notnull'=>1, 'comment'=>"y, m, d, w, h, i",), 'offsetunit' => array('type'=>'varchar(1)', 'label'=>'OffsetUnit', 'visible'=>1, 'enabled'=>1, 'position'=>57, 'notnull'=>1, 'comment'=>"y, m, d, w, h, i",),
'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>58, 'notnull'=>1, 'default'=>0, 'index'=>0, 'arrayofkeyval'=>array('0'=>'ToDo', '1'=>'Done')), 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>58, 'notnull'=>1, 'default'=>0, 'index'=>0, 'arrayofkeyval'=>array('0'=>'ToDo', '1'=>'Done')),
'fk_actioncomm' => array('type'=>'integer', 'label'=>'Project', 'visible'=>1, 'enabled'=>1, 'position'=>59, 'notnull'=>1, 'index'=>1,), 'lasterror' => array('type'=>'varchar(128)', 'label'=>'LastError', 'visible'=>-1, 'enabled'=>1, 'position'=>59, 'index'=>0),
'fk_email_template' => array('type'=>'integer', 'label'=>'EmailTemplate', 'visible'=>1, 'enabled'=>1, 'position'=>60, 'notnull'=>0), 'fk_actioncomm' => array('type'=>'integer', 'label'=>'Project', 'visible'=>1, 'enabled'=>1, 'position'=>70, 'notnull'=>1, 'index'=>1,),
'fk_email_template' => array('type'=>'integer', 'label'=>'EmailTemplate', 'visible'=>1, 'enabled'=>1, 'position'=>80, 'notnull'=>0),
); );
/** /**
@ -114,6 +116,11 @@ class ActionCommReminder extends CommonObject
*/ */
public $status; public $status;
/**
* @var string Last error message
*/
public $lasterror;
/** /**
* @var int Project * @var int Project
*/ */
@ -217,31 +224,19 @@ class ActionCommReminder extends CommonObject
// phpcs:enable // phpcs:enable
global $langs; global $langs;
if ($mode == 0 || $mode == 1) $labelStatus = $langs->trans('ToDo');
{ if ($status == 1) $labelStatus = $langs->trans('Done');
if ($status == 1) return $langs->trans('Done'); elseif ($status == -1) $labelStatus = $langs->trans('Error');
elseif ($status == 0) return $langs->trans('ToDo');
} elseif ($mode == 2) $labelStatusShort = $langs->trans('ToDo');
{ if ($status == 1) $labelStatus = $langs->trans('Done');
if ($status == 1) return img_picto($langs->trans('Done'), 'statut4').' '.$langs->trans('Done'); elseif ($status == -1) $labelStatus = $langs->trans('Error');
elseif ($status == 0) return img_picto($langs->trans('ToDo'), 'statut5').' '.$langs->trans('ToDo');
} elseif ($mode == 3) $statusType = 'status5';
{ if ($status == 1) $statusType = 'status4';
if ($status == 1) return img_picto($langs->trans('Done'), 'statut4'); elseif ($status == -1) $statusType = 'status8';
elseif ($status == 0) return img_picto($langs->trans('ToDo'), 'statut5');
} elseif ($mode == 4) return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode);
{
if ($status == 1) return img_picto($langs->trans('Done'), 'statut4').' '.$langs->trans('Done');
elseif ($status == 0) return img_picto($langs->trans('ToDo'), 'statut5').' '.$langs->trans('ToDo');
} elseif ($mode == 5)
{
if ($status == 1) return $langs->trans('Done').' '.img_picto($langs->trans('Done'), 'statut4');
elseif ($status == 0) return $langs->trans('ToDo').' '.img_picto($langs->trans('ToDo'), 'statut5');
} elseif ($mode == 6)
{
if ($status == 1) return $langs->trans('Done').' '.img_picto($langs->trans('Done'), 'statut4');
elseif ($status == 0) return $langs->trans('ToDo').' '.img_picto($langs->trans('ToDo'), 'statut5');
}
} }
/** /**

View File

@ -1292,7 +1292,7 @@ if ($action == 'create')
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button buttonforacesave" value="'.$langs->trans("Save").'" name="save">'; print '<input type="submit" class="button buttonforacesave button-save" value="'.$langs->trans("Save").'" name="save">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" value="'.$langs->trans("Cancel").'" name="cancel">'; print '<input type="submit" class="button" value="'.$langs->trans("Cancel").'" name="cancel">';
print '</div>'; print '</div>';

View File

@ -107,7 +107,7 @@ if ($_socid > 0)
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>'; print '<div align="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
print "</form>"; print "</form>";

View File

@ -59,10 +59,10 @@ $search_datecloture_start = GETPOST('search_datecloture_start', 'int');
if (empty($search_datecloture_start)) $search_datecloture_start = dol_mktime(0, 0, 0, GETPOST('search_datecloture_startmonth', 'int'), GETPOST('search_datecloture_startday', 'int'), GETPOST('search_datecloture_startyear', 'int')); if (empty($search_datecloture_start)) $search_datecloture_start = dol_mktime(0, 0, 0, GETPOST('search_datecloture_startmonth', 'int'), GETPOST('search_datecloture_startday', 'int'), GETPOST('search_datecloture_startyear', 'int'));
$search_datecloture_end = GETPOST('search_datecloture_end', 'int'); $search_datecloture_end = GETPOST('search_datecloture_end', 'int');
if (empty($search_datecloture_end)) $search_datecloture_end = dol_mktime(23, 59, 59, GETPOST('search_datecloture_endmonth', 'int'), GETPOST('search_datecloture_endday', 'int'), GETPOST('search_datecloture_endyear', 'int')); if (empty($search_datecloture_end)) $search_datecloture_end = dol_mktime(23, 59, 59, GETPOST('search_datecloture_endmonth', 'int'), GETPOST('search_datecloture_endday', 'int'), GETPOST('search_datecloture_endyear', 'int'));
$search_dateorder_start = dol_mktime(0, 0, 0, GETPOST('search_dateorder_startmonth', 'int'), GETPOST('search_dateorder_startday', 'int'), GETPOST('search_dateorder_startyear', 'int')); $search_dateorder_start = dol_mktime(0, 0, 0, GETPOST('search_dateorder_start_month', 'int'), GETPOST('search_dateorder_start_day', 'int'), GETPOST('search_dateorder_start_year', 'int'));
$search_dateorder_end = dol_mktime(23, 59, 59, GETPOST('search_dateorder_endmonth', 'int'), GETPOST('search_dateorder_endday', 'int'), GETPOST('search_dateorder_endyear', 'int')); $search_dateorder_end = dol_mktime(23, 59, 59, GETPOST('search_dateorder_end_month', 'int'), GETPOST('search_dateorder_end_day', 'int'), GETPOST('search_dateorder_end_year', 'int'));
$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_startmonth', 'int'), GETPOST('search_datedelivery_startday', 'int'), GETPOST('search_datedelivery_startyear', 'int')); $search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_start_month', 'int'), GETPOST('search_datedelivery_start_day', 'int'), GETPOST('search_datedelivery_start_year', 'int'));
$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_endmonth', 'int'), GETPOST('search_datedelivery_endday', 'int'), GETPOST('search_datedelivery_endyear', 'int')); $search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_end_month', 'int'), GETPOST('search_datedelivery_end_day', 'int'), GETPOST('search_datedelivery_end_year', 'int'));
$search_product_category = GETPOST('search_product_category', 'int'); $search_product_category = GETPOST('search_product_category', 'int');
$search_ref = GETPOST('search_ref', 'alpha') != '' ?GETPOST('search_ref', 'alpha') : GETPOST('sref', 'alpha'); $search_ref = GETPOST('search_ref', 'alpha') != '' ?GETPOST('search_ref', 'alpha') : GETPOST('sref', 'alpha');
$search_ref_customer = GETPOST('search_ref_customer', 'alpha'); $search_ref_customer = GETPOST('search_ref_customer', 'alpha');
@ -448,10 +448,10 @@ if ($resql)
if ($search_status != '') $param .= '&search_status='.urlencode($search_status); if ($search_status != '') $param .= '&search_status='.urlencode($search_status);
if ($search_datecloture_start) $param .= '&search_datecloture_start='.urlencode($search_datecloture_start); if ($search_datecloture_start) $param .= '&search_datecloture_start='.urlencode($search_datecloture_start);
if ($search_datecloture_end) $param .= '&search_datecloture_end='.urlencode($search_datecloture_end); if ($search_datecloture_end) $param .= '&search_datecloture_end='.urlencode($search_datecloture_end);
if ($search_dateorder_start) $param .= '&search_dateorder_start='.urlencode($search_dateorder_start); if ($search_dateorder_start) $param .= '&search_dateorder_start_day=' . dol_print_date($search_dateorder_start, '%d') . '&search_dateorder_start_month=' . dol_print_date($search_dateorder_start, '%m') . '&search_dateorder_start_year=' . dol_print_date($search_dateorder_start, '%Y');
if ($search_dateorder_end) $param .= '&search_dateorder_end='.urlencode($search_dateorder_end); if ($search_dateorder_end) $param .= '&search_dateorder_end_day=' . dol_print_date($search_dateorder_end, '%d') . '&search_dateorder_end_month=' . dol_print_date($search_dateorder_end, '%m') . '&search_dateorder_end_year=' . dol_print_date($search_dateorder_end, '%Y');
if ($search_datedelivery_start) $param .= '&search_datedelivery_start='.urlencode($search_datedelivery_start); if ($search_datedelivery_start) $param .= '&search_datedelivery_start_day=' . dol_print_date($search_datedelivery_start, '%d') . '&search_datedelivery_start_month=' . dol_print_date($search_datedelivery_start, '%m') . '&search_datedelivery_start_year=' . dol_print_date($search_datedelivery_start, '%Y');
if ($search_datedelivery_end) $param .= '&search_datedelivery_end='.urlencode($search_datedelivery_end); if ($search_datedelivery_end) $param .= '&search_datedelivery_end_day=' . dol_print_date($search_datedelivery_end, '%d') . '&search_datedelivery_end_month=' . dol_print_date($search_datedelivery_end, '%m') . '&search_datedelivery_end_year=' . dol_print_date($search_datedelivery_end, '%Y');
if ($search_ref) $param .= '&search_ref='.urlencode($search_ref); if ($search_ref) $param .= '&search_ref='.urlencode($search_ref);
if ($search_company) $param .= '&search_company='.urlencode($search_company); if ($search_company) $param .= '&search_company='.urlencode($search_company);
if ($search_ref_customer) $param .= '&search_ref_customer='.urlencode($search_ref_customer); if ($search_ref_customer) $param .= '&search_ref_customer='.urlencode($search_ref_customer);
@ -708,10 +708,10 @@ if ($resql)
{ {
print '<td class="liste_titre center">'; print '<td class="liste_titre center">';
print '<div class="nowrap">'; print '<div class="nowrap">';
print $form->selectDate($search_dateorder_start ? $search_dateorder_start : -1, 'search_dateorder_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); print $form->selectDate($search_dateorder_start ? $search_dateorder_start : -1, 'search_dateorder_start_', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print '</div>'; print '</div>';
print '<div class="nowrap">'; print '<div class="nowrap">';
print $form->selectDate($search_dateorder_end ? $search_dateorder_end : -1, 'search_dateorder_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); print $form->selectDate($search_dateorder_end ? $search_dateorder_end : -1, 'search_dateorder_end_', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
print '</div>'; print '</div>';
print '</td>'; print '</td>';
} }
@ -719,10 +719,10 @@ if ($resql)
{ {
print '<td class="liste_titre center">'; print '<td class="liste_titre center">';
print '<div class="nowrap">'; print '<div class="nowrap">';
print $form->selectDate($search_datedelivery_start ? $search_datedelivery_start : -1, 'search_datedelivery_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); print $form->selectDate($search_datedelivery_start ? $search_datedelivery_start : -1, 'search_datedelivery_start_', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print '</div>'; print '</div>';
print '<div class="nowrap">'; print '<div class="nowrap">';
print $form->selectDate($search_datedelivery_end ? $search_datedelivery_end : -1, 'search_datedelivery_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); print $form->selectDate($search_datedelivery_end ? $search_datedelivery_end : -1, 'search_datedelivery_end_', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
print '</div>'; print '</div>';
print '</td>'; print '</td>';
} }

View File

@ -463,7 +463,7 @@ if ($action == 'create')
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
print ' &nbsp; '; print ' &nbsp; ';
print '<input type="button" class="button" value="'.$langs->trans("Cancel").'" onclick="javascript:history.go(-1)">'; print '<input type="button" class="button" value="'.$langs->trans("Cancel").'" onclick="javascript:history.go(-1)">';
print '</div>'; print '</div>';

View File

@ -568,7 +568,7 @@ if ($action == "create" || $action == "start" || $action == 'close')
// Save // Save
print '<td class="center">'; print '<td class="center">';
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
if ($action == 'start') print '<input type="submit" name="add" class="button" value="'.$langs->trans("Save").'">'; if ($action == 'start') print '<input type="submit" name="add" class="button button-save" value="'.$langs->trans("Save").'">';
elseif ($action == 'close') print '<input type="submit" name="valid" class="button" value="'.$langs->trans("Validate").'">'; elseif ($action == 'close') print '<input type="submit" name="valid" class="button" value="'.$langs->trans("Validate").'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -854,7 +854,7 @@ if (empty($action) || $action == "view" || $action == "close")
// Save // Save
print '<td class="center">'; print '<td class="center">';
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
if ($action == 'start') print '<input type="submit" name="add" class="button" value="'.$langs->trans("Save").'">'; if ($action == 'start') print '<input type="submit" name="add" class="button button-save" value="'.$langs->trans("Save").'">';
elseif ($action == 'close') print '<input type="submit" name="valid" class="button" value="'.$langs->trans("Close").'">'; elseif ($action == 'close') print '<input type="submit" name="valid" class="button" value="'.$langs->trans("Close").'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -278,7 +278,7 @@ if ($action == 'create')
print '</table>'; print '</table>';
print '<br><div class="center">'; print '<br><div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';
@ -374,7 +374,7 @@ if ($action == 'create')
print '</table>'; print '</table>';
print '<br><div class="center">'; print '<br><div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -201,7 +201,7 @@ if ($action == 'create')
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -681,7 +681,7 @@ if ($id > 0)
if ($action == 'edit') if ($action == 'edit')
{ {
print '<div align="center">'; print '<div align="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; '; print ' &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -296,7 +296,7 @@ if ($action == 'create')
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -152,7 +152,7 @@ if (!empty($this->control->tpl['contact_element'])) {
<tr> <tr>
<td colspan="4" class="center"> <td colspan="4" class="center">
<input type="submit" class="button" name="save" value="<?php echo $langs->trans("Save"); ?>">&nbsp; <input type="submit" class="button button-save" name="save" value="<?php echo $langs->trans("Save"); ?>">&nbsp;
<input type="submit" class="button" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>"> <input type="submit" class="button" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>">
</td> </td>
</tr> </tr>

View File

@ -1239,7 +1239,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; &nbsp; '; print ' &nbsp; &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -207,7 +207,7 @@ if ($action == 'edit')
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

View File

@ -7907,7 +7907,7 @@ abstract class CommonObject
}*/ }*/
} }
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET '.implode(',', $tmp).' WHERE rowid='.$this->id; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET '.implode(', ', $tmp).' WHERE rowid='.$this->id;
$this->db->begin(); $this->db->begin();
if (!$error) if (!$error)

View File

@ -6259,7 +6259,7 @@ class Form
* Note: Do not apply langs->trans function on returned content, content may be entity encoded twice. * Note: Do not apply langs->trans function on returned content, content may be entity encoded twice.
* *
* @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect * @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect
* @param array $array Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>...)) * @param array $array Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>..., 'disabled'=>..., 'css'=>...))
* @param string|string[] $id Preselected key or preselected keys for multiselect * @param string|string[] $id Preselected key or preselected keys for multiselect
* @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (key is -1 and value is '' or '&nbsp;' if 1, key is -1 and value is text if string), <0 to add an empty value with key that is this value. * @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (key is -1 and value is '' or '&nbsp;' if 1, key is -1 and value is text if string), <0 to add an empty value with key that is this value.
* @param int $key_in_label 1 to show key into label with format "[key] value" * @param int $key_in_label 1 to show key into label with format "[key] value"
@ -6331,10 +6331,14 @@ class Form
foreach ($array as $key => $tmpvalue) foreach ($array as $key => $tmpvalue)
{ {
if (is_array($tmpvalue)) $value = $tmpvalue['label']; if (is_array($tmpvalue)) {
else $value = $tmpvalue; $value = $tmpvalue['label'];
$disabled = empty($tmpvalue['disabled']) ? '' : ' disabled';
$disabled = ''; $style = ''; $style = empty($tmpvalue['css']) ? ' class="'.$tmpvalue['css'].'"' : '';
} else {
$value = $tmpvalue;
$disabled = ''; $style = '';
}
if (!empty($disablebademail)) if (!empty($disablebademail))
{ {
if (($disablebademail == 1 && !preg_match('/&lt;.+@.+&gt;/', $value)) if (($disablebademail == 1 && !preg_match('/&lt;.+@.+&gt;/', $value))
@ -7489,10 +7493,11 @@ class Form
* @param string $imagesize 'mini', 'small' or '' (original) * @param string $imagesize 'mini', 'small' or '' (original)
* @param int $addlinktofullsize Add link to fullsize image * @param int $addlinktofullsize Add link to fullsize image
* @param int $cache 1=Accept to use image in cache * @param int $cache 1=Accept to use image in cache
* @param string $forcecapture Force parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if empty. * @param string $forcecapture '', 'user' or 'environment'. Force parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if ''.
* @param int $noexternsourceoverwrite No overwrite image with extern source (like 'gravatar' or other module)
* @return string HTML code to output photo * @return string HTML code to output photo
*/ */
public static function showphoto($modulepart, $object, $width = 100, $height = 0, $caneditfield = 0, $cssclass = 'photowithmargin', $imagesize = '', $addlinktofullsize = 1, $cache = 0, $forcecapture = '') public static function showphoto($modulepart, $object, $width = 100, $height = 0, $caneditfield = 0, $cssclass = 'photowithmargin', $imagesize = '', $addlinktofullsize = 1, $cache = 0, $forcecapture = '', $noexternsourceoverwrite = 0)
{ {
global $conf, $langs; global $conf, $langs;
@ -7569,18 +7574,15 @@ class Form
{ {
if ($file && file_exists($dir."/".$file)) if ($file && file_exists($dir."/".$file))
{ {
if ($addlinktofullsize) if ($addlinktofullsize) {
{
$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
if ($urladvanced) $ret .= '<a href="'.$urladvanced.'">'; if ($urladvanced) $ret .= '<a href="'.$urladvanced.'">';
else $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; else $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
} }
$ret .= '<img alt="Photo" class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').' photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">'; $ret .= '<img alt="Photo" class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').' photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
if ($addlinktofullsize) $ret .= '</a>'; if ($addlinktofullsize) $ret .= '</a>';
} elseif ($altfile && file_exists($dir."/".$altfile)) } elseif ($altfile && file_exists($dir."/".$altfile)) {
{ if ($addlinktofullsize) {
if ($addlinktofullsize)
{
$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
if ($urladvanced) $ret .= '<a href="'.$urladvanced.'">'; if ($urladvanced) $ret .= '<a href="'.$urladvanced.'">';
else $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; else $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
@ -7589,8 +7591,7 @@ class Form
if ($addlinktofullsize) $ret .= '</a>'; if ($addlinktofullsize) $ret .= '</a>';
} else { } else {
$nophoto = '/public/theme/common/nophoto.png'; $nophoto = '/public/theme/common/nophoto.png';
if (in_array($modulepart, array('userphoto', 'contact', 'memberphoto'))) // For module that are "physical" users if (in_array($modulepart, array('userphoto', 'contact', 'memberphoto'))) { // For module that are "physical" users
{
if ($modulepart == 'memberphoto' && strpos($object->morphy, 'mor') !== false) { if ($modulepart == 'memberphoto' && strpos($object->morphy, 'mor') !== false) {
$nophoto = '/public/theme/common/company.png'; $nophoto = '/public/theme/common/company.png';
} else { } else {
@ -7600,11 +7601,8 @@ class Form
} }
} }
if (!empty($conf->gravatar->enabled) && $email) if (!empty($conf->gravatar->enabled) && $email && empty($noexternsourceoverwrite)) {
{ // see https://gravatar.com/site/implement/images/php/
/**
* @see https://gravatar.com/site/implement/images/php/
*/
global $dolibarr_main_url_root; global $dolibarr_main_url_root;
$ret .= '<!-- Put link to gravatar -->'; $ret .= '<!-- Put link to gravatar -->';
//$defaultimg=urlencode(dol_buildpath($nophoto,3)); //$defaultimg=urlencode(dol_buildpath($nophoto,3));

View File

@ -1362,7 +1362,7 @@ class FormFile
} else { } else {
print '<td class="right">'; print '<td class="right">';
print '<input type="hidden" name="ecmfileid" value="'.$filearray[$key]['rowid'].'">'; print '<input type="hidden" name="ecmfileid" value="'.$filearray[$key]['rowid'].'">';
print '<input type="submit" class="button" name="renamefilesave" value="'.dol_escape_htmltag($langs->trans("Save")).'">'; print '<input type="submit" class="button button-save" name="renamefilesave" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">'; print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
print '</td>'; print '</td>';
if (empty($disablemove)) print '<td class="right"></td>'; if (empty($disablemove)) print '<td class="right"></td>';

View File

@ -85,10 +85,19 @@ function dol_quoted_printable_encode($input, $line_max = 76)
*/ */
class vCard class vCard
{ {
/**
* @var array array of properties
*/
public $properties; public $properties;
/**
* @var string filename
*/
public $filename; public $filename;
//var $encoding="UTF-8"; /**
* @var string encoding
*/
public $encoding = "ISO-8859-1;ENCODING=QUOTED-PRINTABLE"; public $encoding = "ISO-8859-1;ENCODING=QUOTED-PRINTABLE";

View File

@ -356,13 +356,10 @@ function agenda_prepare_head()
$head[$h][2] = 'autoactions'; $head[$h][2] = 'autoactions';
$h++; $h++;
if ($conf->global->MAIN_FEATURES_LEVEL > 0) $head[$h][0] = DOL_URL_ROOT."/admin/agenda_reminder.php";
{ $head[$h][1] = $langs->trans("Reminders");
$head[$h][0] = DOL_URL_ROOT."/admin/agenda_reminder.php"; $head[$h][2] = 'reminders';
$head[$h][1] = $langs->trans("Reminders"); $h++;
$head[$h][2] = 'reminders';
$h++;
}
$head[$h][0] = DOL_URL_ROOT."/admin/agenda_xcal.php"; $head[$h][0] = DOL_URL_ROOT."/admin/agenda_xcal.php";
$head[$h][1] = $langs->trans("ExportCal"); $head[$h][1] = $langs->trans("ExportCal");

View File

@ -39,6 +39,11 @@ function cronadmin_prepare_head()
$head[$h][2] = 'setup'; $head[$h][2] = 'setup';
$h++; $h++;
$head[$h][0] = dol_buildpath('/cron/list.php?mode=modulesetup', 1);
$head[$h][1] = $langs->trans("Module2300Name");
$head[$h][2] = 'jobs';
$h++;
complete_head_from_modules($conf, $langs, null, $head, $h, 'cronadmin'); complete_head_from_modules($conf, $langs, null, $head, $h, 'cronadmin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'cronadmin', 'remove'); complete_head_from_modules($conf, $langs, null, $head, $h, 'cronadmin', 'remove');

View File

@ -78,7 +78,7 @@ function getServerTimeZoneString()
* Return server timezone int. * Return server timezone int.
* *
* @param string $refgmtdate Reference period for timezone (timezone differs on winter and summer. May be 'now', 'winter' or 'summer') * @param string $refgmtdate Reference period for timezone (timezone differs on winter and summer. May be 'now', 'winter' or 'summer')
* @return int An offset in hour (+1 for Europe/Paris on winter and +2 for Europe/Paris on summer) * @return float An offset in hour (+1 for Europe/Paris on winter and +2 for Europe/Paris on summer). Note some countries use half and even quarter hours.
*/ */
function getServerTimeZoneInt($refgmtdate = 'now') function getServerTimeZoneInt($refgmtdate = 'now')
{ {

View File

@ -1668,13 +1668,11 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
$phototoshow .= '</div>'; $phototoshow .= '</div>';
} }
} }
} elseif (!$phototoshow) } elseif (!$phototoshow) {
{
$phototoshow .= $form->showphoto($modulepart, $object, 0, 0, 0, 'photoref', 'small', 1, 0, $maxvisiblephotos); $phototoshow .= $form->showphoto($modulepart, $object, 0, 0, 0, 'photoref', 'small', 1, 0, $maxvisiblephotos);
} }
if ($phototoshow) if ($phototoshow) {
{
$morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">'; $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">';
$morehtmlleft .= $phototoshow; $morehtmlleft .= $phototoshow;
$morehtmlleft .= '</div>'; $morehtmlleft .= '</div>';
@ -3096,7 +3094,7 @@ function dol_substr($string, $start, $length, $stringencoding = '', $trunconbyte
* *
* @param string $string String to truncate * @param string $string String to truncate
* @param int $size Max string size visible (excluding ...). 0 for no limit. WARNING: Final string size can have 3 more chars (if we added ..., or if size was max+1 or max+2 or max+3 so it does not worse to replace with ...) * @param int $size Max string size visible (excluding ...). 0 for no limit. WARNING: Final string size can have 3 more chars (if we added ..., or if size was max+1 or max+2 or max+3 so it does not worse to replace with ...)
* @param string $trunc Where to trunc: right, left, middle (size must be a 2 power), wrap * @param string $trunc Where to trunc: 'right', 'left', 'middle' (size must be a 2 power), 'wrap'
* @param string $stringencoding Tell what is source string encoding * @param string $stringencoding Tell what is source string encoding
* @param int $nodot Truncation do not add ... after truncation. So it's an exact truncation. * @param int $nodot Truncation do not add ... after truncation. So it's an exact truncation.
* @param int $display Trunc is used to display data and can be changed for small screen. TODO Remove this param (must be dealt with CSS) * @param int $display Trunc is used to display data and can be changed for small screen. TODO Remove this param (must be dealt with CSS)

View File

@ -1625,7 +1625,7 @@ function pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails = 0)
{ {
if (empty($hidedetails) || $hidedetails > 1) if (empty($hidedetails) || $hidedetails > 1)
{ {
$subprice = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_subprice : $object->lines[$i]->subprice); $subprice = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_subprice : $object->lines[$i]->subprice);
$result .= price($sign * $subprice, 0, $outputlangs); $result .= price($sign * $subprice, 0, $outputlangs);
} }
} }
@ -1966,7 +1966,7 @@ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0)
} }
elseif (empty($hidedetails) || $hidedetails > 1) elseif (empty($hidedetails) || $hidedetails > 1)
{ {
$total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ht : $object->lines[$i]->total_ht); $total_ht = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ht : $object->lines[$i]->total_ht);
if ($object->lines[$i]->situation_percent > 0) if ($object->lines[$i]->situation_percent > 0)
{ {
// TODO Remove this. The total should be saved correctly in database instead of being modified here. // TODO Remove this. The total should be saved correctly in database instead of being modified here.
@ -2023,7 +2023,7 @@ function pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails = 0)
} }
elseif (empty($hidedetails) || $hidedetails > 1) elseif (empty($hidedetails) || $hidedetails > 1)
{ {
$total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ttc : $object->lines[$i]->total_ttc); $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ttc : $object->lines[$i]->total_ttc);
if ($object->lines[$i]->situation_percent > 0) if ($object->lines[$i]->situation_percent > 0)
{ {
// TODO Remove this. The total should be saved correctly in database instead of being modified here. // TODO Remove this. The total should be saved correctly in database instead of being modified here.

View File

@ -678,10 +678,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print $hookmanager->resPrint; print $hookmanager->resPrint;
// Tick to drag and drop // Tick to drag and drop
if ($addordertick) print '<td class="tdlineupdown center"></td>';
{
print '<td class="tdlineupdown hideonsmartphone center">&nbsp;</td>';
}
print "</tr>\n"; print "</tr>\n";
@ -796,7 +793,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
{ {
print '<td></td>'; print '<td></td>';
} }
if ($addordertick) print '<td class="hideonsmartphone"></td>'; print '<td class=""></td>';
print '</tr>'; print '</tr>';
} }

View File

@ -113,7 +113,7 @@ class modAgenda extends DolibarrModules
//------------ //------------
$datestart = dol_now(); $datestart = dol_now();
$this->cronjobs = array( $this->cronjobs = array(
0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>10, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'$conf->agenda->enabled', 'datestart'=>$datestart), 0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>5, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'$conf->agenda->enabled', 'datestart'=>$datestart),
); );
// Permissions // Permissions

View File

@ -213,7 +213,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php<br>Contact:con
<?php print dol_get_fiche_end(); ?> <?php print dol_get_fiche_end(); ?>
<div class="center"><input type="submit" name="button" class="button" value="<?php echo $langs->trans("Save"); ?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <div class="center"><input type="submit" name="button" class="button button-save" value="<?php echo $langs->trans("Save"); ?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="button" class="button" value="<?php echo $langs->trans("Cancel"); ?>"></div> <input type="submit" name="button" class="button" value="<?php echo $langs->trans("Cancel"); ?>"></div>
</form> </form>

View File

@ -303,7 +303,7 @@ if (in_array($type, array_keys($typewecanchangeinto)))
<?php print dol_get_fiche_end(); ?> <?php print dol_get_fiche_end(); ?>
<div class="center"><input type="submit" name="button" class="button" value="<?php echo $langs->trans("Save"); ?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <div class="center"><input type="submit" name="button" class="button button-save" value="<?php echo $langs->trans("Save"); ?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="button" class="button" value="<?php echo $langs->trans("Cancel"); ?>"></div> <input type="submit" name="button" class="button" value="<?php echo $langs->trans("Cancel"); ?>"></div>
</form> </form>

View File

@ -44,7 +44,8 @@ $forcereloadpage = empty($conf->global->MAIN_FORCE_RELOAD_PAGE) ? 0 : 1;
$tagidfortablednd = (empty($tagidfortablednd) ? 'tablelines' : $tagidfortablednd); $tagidfortablednd = (empty($tagidfortablednd) ? 'tablelines' : $tagidfortablednd);
$filepath = (empty($filepath) ? '' : $filepath); $filepath = (empty($filepath) ? '' : $filepath);
if (GETPOST('action', 'aZ09') != 'editline' && $nboflines > 1) { ?>
if (GETPOST('action', 'aZ09') != 'editline' && $nboflines > 1 && $conf->browser->layout != 'phone') { ?>
<script> <script>
$(document).ready(function(){ $(document).ready(function(){
$(".imgupforline").hide(); $(".imgupforline").hide();

View File

@ -255,7 +255,7 @@ $coldisplay++;
<!-- colspan for this td because it replace total_ht+3 td for buttons+... --> <!-- colspan for this td because it replace total_ht+3 td for buttons+... -->
<td class="center valignmiddle" colspan="<?php echo $colspan; ?>"><?php $coldisplay += $colspan; ?> <td class="center valignmiddle" colspan="<?php echo $colspan; ?>"><?php $coldisplay += $colspan; ?>
<input type="submit" class="button buttongen marginbottomonly" id="savelinebutton marginbottomonly" name="save" value="<?php echo $langs->trans("Save"); ?>"><br> <input type="submit" class="button buttongen marginbottomonly button-save" id="savelinebutton marginbottomonly" name="save" value="<?php echo $langs->trans("Save"); ?>"><br>
<input type="submit" class="button buttongen marginbottomonly" id="cancellinebutton" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>"> <input type="submit" class="button buttongen marginbottomonly" id="cancellinebutton" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>">
</td> </td>
</tr> </tr>

View File

@ -35,7 +35,7 @@ $langs->loadLangs(array('admin', 'cron'));
if (!$user->admin) if (!$user->admin)
accessforbidden(); accessforbidden();
$actionsave = GETPOST("save"); $actionsave = GETPOST("save", 'alphanohtml');
// Save parameters // Save parameters
if (!empty($actionsave)) if (!empty($actionsave))
@ -75,6 +75,8 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
print dol_get_fiche_head($head, 'setup', $langs->trans("Module2300Name"), -1, 'cron'); print dol_get_fiche_head($head, 'setup', $langs->trans("Module2300Name"), -1, 'cron');
print '<span class="opacitymedium">'.$langs->trans('CronInfo').'</span><br>';
print "<br>\n"; print "<br>\n";
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
@ -108,7 +110,7 @@ print '</table>';
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" name="save" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" name="save" class="button button-save" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';
@ -116,7 +118,7 @@ print '</form>';
print '<br><br><br>'; print '<br><br><br>';
print $langs->trans("UseMenuModuleToolsToAddCronJobs", dol_buildpath('/cron/list.php?leftmenu=admintools', 1)).'<br>'; //print $langs->trans("UseMenuModuleToolsToAddCronJobs", dol_buildpath('/cron/list.php?leftmenu=admintools', 1)).'<br>';
if (!empty($conf->global->CRON_WARNING_DELAY_HOURS)) print info_admin($langs->trans("WarningCronDelayed", $conf->global->CRON_WARNING_DELAY_HOURS)).'<br>'; if (!empty($conf->global->CRON_WARNING_DELAY_HOURS)) print info_admin($langs->trans("WarningCronDelayed", $conf->global->CRON_WARNING_DELAY_HOURS)).'<br>';
print '<br>'; print '<br>';

View File

@ -42,7 +42,9 @@ $id = GETPOST('id', 'int');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha'); $confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'alpha'); $cancel = GETPOST('cancel', 'alpha');
$backtourl = GETPOST('backtourl', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
$securitykey = GETPOST('securitykey', 'alpha'); $securitykey = GETPOST('securitykey', 'alpha');
@ -62,13 +64,13 @@ if (!empty($id))
if (!empty($cancel)) if (!empty($cancel))
{ {
if (!empty($id) && empty($backtourl)) if (!empty($id) && empty($backtopage))
{ {
$action = ''; $action = '';
} else { } else {
if ($backtourl) if ($backtopage)
{ {
header("Location: ".$backtourl); header("Location: ".$backtopage);
exit; exit;
} else { } else {
header("Location: ".DOL_URL_ROOT.'/cron/list.php'); header("Location: ".DOL_URL_ROOT.'/cron/list.php');
@ -297,7 +299,7 @@ if (($action == "create") || ($action == "edit"))
{ {
print '<form name="cronform" action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<form name="cronform" action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">'."\n"; print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
print '<input type="hidden" name="backtourl" value="'.GETPOST('backtourl').'">'."\n"; print '<input type="hidden" name="backtopage" value="'.GETPOST('backtopage').'">'."\n";
if (!empty($object->id)) { if (!empty($object->id)) {
print '<input type="hidden" name="action" value="update">'."\n"; print '<input type="hidden" name="action" value="update">'."\n";
print '<input type="hidden" name="id" value="'.$object->id.'">'."\n"; print '<input type="hidden" name="id" value="'.$object->id.'">'."\n";
@ -513,7 +515,7 @@ if (($action == "create") || ($action == "edit"))
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div align="center">'; print '<div align="center">';
print '<input type="submit" name="save" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" name="save" class="button button-save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
print "</div>"; print "</div>";

View File

@ -289,10 +289,12 @@ class Cronjob extends CommonObject
/** /**
* Load object in memory from the database * Load object in memory from the database
* *
* @param int $id Id object * @param int $id Id object
* @return int <0 if KO, >0 if OK * @param string $objectname Object name
* @param string $methodname Method name
* @return int <0 if KO, >0 if OK
*/ */
public function fetch($id) public function fetch($id, $objectname = '', $methodname = '')
{ {
$sql = "SELECT"; $sql = "SELECT";
$sql .= " t.rowid,"; $sql .= " t.rowid,";
@ -328,7 +330,13 @@ class Cronjob extends CommonObject
$sql .= " t.libname,"; $sql .= " t.libname,";
$sql .= " t.test"; $sql .= " t.test";
$sql .= " FROM ".MAIN_DB_PREFIX."cronjob as t"; $sql .= " FROM ".MAIN_DB_PREFIX."cronjob as t";
$sql .= " WHERE t.rowid = ".$id; if ($id > 0) {
$sql .= " WHERE t.rowid = ".$id;
} else {
$sql .= " WHERE t.entity IN(0, ".getEntity('cron').")";
$sql .= " AND t.objectname = '".$this->db->escape($objectname)."'";
$sql .= " AND t.methodename = '".$this->db->escape($methodname)."'";
}
dol_syslog(get_class($this)."::fetch", LOG_DEBUG); dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
@ -1044,7 +1052,10 @@ class Cronjob extends CommonObject
$object = new $this->objectname($this->db); $object = new $this->objectname($this->db);
if ($this->entity > 0) $object->entity = $this->entity; // We work on a dedicated entity if ($this->entity > 0) $object->entity = $this->entity; // We work on a dedicated entity
$params_arr = array_map('trim', explode(",", $this->params)); $params_arr = array();
if (!empty($this->params) || $this->params === '0') {
$params_arr = array_map('trim', explode(",", $this->params));
}
if (!is_array($params_arr)) if (!is_array($params_arr))
{ {
@ -1233,7 +1244,7 @@ class Cronjob extends CommonObject
if (($this->maxrun > 0 && ($this->nbrun >= $this->maxrun)) if (($this->maxrun > 0 && ($this->nbrun >= $this->maxrun))
|| ($this->dateend && ($this->datenextrun > $this->dateend))) || ($this->dateend && ($this->datenextrun > $this->dateend)))
{ {
$this->status = 2; $this->status = self::STATUS_ARCHIVED;
dol_syslog(get_class($this)."::reprogram_jobs Job will be set to archived", LOG_ERR); dol_syslog(get_class($this)."::reprogram_jobs Job will be set to archived", LOG_ERR);
} }
} }

View File

@ -55,10 +55,12 @@ $pagenext = $page + 1;
if (!$sortfield) $sortfield = 't.status,t.priority'; if (!$sortfield) $sortfield = 't.status,t.priority';
if (!$sortorder) $sortorder = 'DESC,ASC'; if (!$sortorder) $sortorder = 'DESC,ASC';
$search_status = (GETPOSTISSET('search_status') ?GETPOST('search_status', 'int') : GETPOST('status', 'int')); $mode = GETPOST('mode', 'aZ09');
//Search criteria //Search criteria
$search_status = (GETPOSTISSET('search_status') ?GETPOST('search_status', 'int') : GETPOST('status', 'int'));
$search_label = GETPOST("search_label", 'alpha'); $search_label = GETPOST("search_label", 'alpha');
$search_module_name = GETPOST("search_module_name", 'alpha');
$securitykey = GETPOST('securitykey', 'alpha'); $securitykey = GETPOST('securitykey', 'alpha');
$diroutputmassaction = $conf->cronjob->dir_output.'/temp/massgeneration/'.$user->id; $diroutputmassaction = $conf->cronjob->dir_output.'/temp/massgeneration/'.$user->id;
@ -211,7 +213,6 @@ $pagetitle = $langs->trans("CronList");
llxHeader('', $pagetitle); llxHeader('', $pagetitle);
$sql = "SELECT"; $sql = "SELECT";
$sql .= " t.rowid,"; $sql .= " t.rowid,";
$sql .= " t.tms,"; $sql .= " t.tms,";
@ -254,8 +255,8 @@ if (is_array($filter) && count($filter) > 0) {
} }
} }
$sqlwhere = array(); $sqlwhere = array();
if (!empty($module_name)) { if (!empty($search_module_name)) {
$sqlwhere[] = '(t.module_name='.$db->escape($module_name).')'; $sqlwhere[] = '(t.module_name='.$db->escape($search_module_name).')';
} }
if (count($sqlwhere) > 0) { if (count($sqlwhere) > 0) {
$sql .= " WHERE ".implode(' AND ', $sqlwhere); $sql .= " WHERE ".implode(' AND ', $sqlwhere);
@ -296,6 +297,8 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&co
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
if ($search_status) $param .= '&search_status='.urlencode($search_status); if ($search_status) $param .= '&search_status='.urlencode($search_status);
if ($search_label) $param .= '&search_label='.urlencode($search_label); if ($search_label) $param .= '&search_label='.urlencode($search_label);
if ($search_module_name) $param .= '&search_module_name='.urlencode($search_module_name);
if ($mode) $param .= '&mode='.urlencode($mode);
if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
// Add $param from extra fields // Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
@ -322,6 +325,13 @@ if ($user->rights->mymodule->delete) $arrayofmassactions['predelete'] = '<span c
if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
$massactionbutton = $form->selectMassAction('', $arrayofmassactions); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
if ($mode == 'modulesetup') {
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("CronSetup"), $linkback, 'title_setup');
// Configuration header
$head = cronadmin_prepare_head();
}
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'" name="search_form">'."\n"; print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'" name="search_form">'."\n";
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
@ -332,15 +342,21 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
// Line with explanation and button new // Line with explanation and button new
$newcardbutton = dolGetButtonTitle($langs->trans('New'), $langs->trans('CronCreateJob'), 'fa fa-plus-circle', DOL_URL_ROOT.'/cron/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $user->rights->cron->create); $newcardbutton = dolGetButtonTitle($langs->trans('New'), $langs->trans('CronCreateJob'), 'fa fa-plus-circle', DOL_URL_ROOT.'/cron/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF'].'?mode=modulesetup'), '', $user->rights->cron->create);
print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_setup', 0, $newcardbutton, '', $limit); if ($mode == 'modulesetup') {
print dol_get_fiche_head($head, 'jobs', $langs->trans("Module2300Name"), -1, 'cron');
//print '<span class="opacitymedium">'.$langs->trans('CronInfo').'</span><br>';
}
print '<span class="opacitymedium">'.$langs->trans('CronInfo').'</span><br>'; print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, ($mode == 'modulesetup' ? '' : 'title_setup'), 0, $newcardbutton, '', $limit);
$text = $langs->trans("HoursOnThisPageAreOnServerTZ").' '.$stringcurrentdate.'<br>'; $text = $langs->trans("HoursOnThisPageAreOnServerTZ").' '.$stringcurrentdate.'<br>';
if (!empty($conf->global->CRON_WARNING_DELAY_HOURS)) $text .= $langs->trans("WarningCronDelayed", $conf->global->CRON_WARNING_DELAY_HOURS); if (!empty($conf->global->CRON_WARNING_DELAY_HOURS)) $text .= $langs->trans("WarningCronDelayed", $conf->global->CRON_WARNING_DELAY_HOURS);
@ -533,11 +549,11 @@ if ($num > 0)
print '<td class="nowraponall right">'; print '<td class="nowraponall right">';
$backtourl = urlencode($_SERVER["PHP_SELF"].'?'.$param.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '')); $backtopage = urlencode($_SERVER["PHP_SELF"].'?'.$param.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : ''));
if ($user->rights->cron->create) if ($user->rights->cron->create)
{ {
print '<a class="editfielda" href="'.DOL_URL_ROOT."/cron/card.php?id=".$obj->rowid.'&action=edit&token='.newToken().($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').$param; print '<a class="editfielda" href="'.DOL_URL_ROOT."/cron/card.php?id=".$obj->rowid.'&action=edit&token='.newToken().($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').$param;
print "&backtourl=".$backtourl."\" title=\"".dol_escape_htmltag($langs->trans('Edit'))."\">".img_picto($langs->trans('Edit'), 'edit')."</a> &nbsp;"; print "&backtopage=".$backtopage."\" title=\"".dol_escape_htmltag($langs->trans('Edit'))."\">".img_picto($langs->trans('Edit'), 'edit')."</a> &nbsp;";
} }
if ($user->rights->cron->delete) if ($user->rights->cron->delete)
{ {
@ -581,11 +597,10 @@ print '</div>';
print '</from>'; print '</from>';
if ($mode == 'modulesetup') {
print dol_get_fiche_end();
}
print '<br><br>';
dol_print_cron_urls();
llxFooter(); llxFooter();

View File

@ -135,7 +135,7 @@ if ($action == 'edit')
print '</table>'; print '</table>';
print '<br><div class="center">'; print '<br><div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';

View File

@ -141,28 +141,27 @@ if ($action == 'update')
{ {
$object->fetch($id); $object->fetch($id);
$object->firstname = GETPOST("firstname", 'alpha'); $object->firstname = (string) GETPOST("firstname", 'alpha');
$object->lastname = GETPOST("lastname", 'alpha'); $object->lastname = (string) GETPOST("lastname", 'alpha');
$object->societe = GETPOST("societe", 'alpha'); $object->societe = (string) GETPOST("societe", 'alpha');
$object->address = GETPOST("address", 'alpha'); $object->address = (string) GETPOST("address", 'alpha');
$object->amount = price2num(GETPOST("amount", 'alpha')); $object->amount = price2num(GETPOST("amount", 'alpha'));
$object->town = GETPOST("town", 'alpha'); $object->town = (string) GETPOST("town", 'alpha');
$object->zip = GETPOST("zipcode", 'alpha'); $object->zip = (string) GETPOST("zipcode", 'alpha');
$object->country_id = GETPOST('country_id', 'int'); $object->country_id = (int) GETPOST('country_id', 'int');
$object->email = GETPOST("email", 'alpha'); $object->email = (string) GETPOST("email", 'alpha');
$object->date = $donation_date; $object->date = $donation_date;
$object->public = GETPOST("public", 'alpha'); $object->public = (string) GETPOST("public", 'alpha');
$object->fk_project = GETPOST("fk_project", 'alpha'); $object->fk_project = GETPOST("fk_project", 'alpha');
$object->note_private = GETPOST("note_private", 'restricthtml'); $object->note_private = (string) GETPOST("note_private", 'restricthtml');
$object->note_public = GETPOST("note_public", 'restricthtml'); $object->note_public = (string) GETPOST("note_public", 'restricthtml');
$object->modepaymentid = GETPOST('modepayment', 'int'); $object->modepaymentid = (int) GETPOST('modepayment', 'int');
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object); $ret = $extrafields->setOptionalsFromPost(null, $object);
if ($ret < 0) $error++; if ($ret < 0) $error++;
if ($object->update($user) > 0) if ($object->update($user) > 0) {
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit; exit;
} }
@ -195,30 +194,29 @@ if ($action == 'add')
if (!$error) if (!$error)
{ {
$object->socid = GETPOST("socid", 'int'); $object->socid = (int) GETPOST("socid", 'int');
$object->firstname = GETPOST("firstname", 'alpha'); $object->firstname = (string) GETPOST("firstname", 'alpha');
$object->lastname = GETPOST("lastname", 'alpha'); $object->lastname = (string) GETPOST("lastname", 'alpha');
$object->societe = GETPOST("societe", 'alpha'); $object->societe = (string) GETPOST("societe", 'alpha');
$object->address = GETPOST("address", 'alpha'); $object->address = (string) GETPOST("address", 'alpha');
$object->amount = price2num(GETPOST("amount", 'alpha')); $object->amount = price2num(GETPOST("amount", 'alpha'));
$object->zip = GETPOST("zipcode", 'alpha'); $object->zip = (string) GETPOST("zipcode", 'alpha');
$object->town = GETPOST("town", 'alpha'); $object->town = (string) GETPOST("town", 'alpha');
$object->country_id = GETPOST('country_id', 'int'); $object->country_id = (int) GETPOST('country_id', 'int');
$object->email = GETPOST('email', 'alpha'); $object->email = (string) GETPOST('email', 'alpha');
$object->date = $donation_date; $object->date = $donation_date;
$object->note_private = GETPOST("note_private", 'restricthtml'); $object->note_private = (string) GETPOST("note_private", 'restricthtml');
$object->note_public = GETPOST("note_public", 'restricthtml'); $object->note_public = (string) GETPOST("note_public", 'restricthtml');
$object->public = GETPOST("public", 'alpha'); $object->public = (string) GETPOST("public", 'alpha');
$object->fk_project = GETPOST("fk_project", 'alpha'); $object->fk_project = (string) GETPOST("fk_project", 'alpha');
$object->modepaymentid = GETPOST('modepayment', 'int'); $object->modepaymentid = (int) GETPOST('modepayment', 'int');
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object); $ret = $extrafields->setOptionalsFromPost(null, $object);
if ($ret < 0) $error++; if ($ret < 0) $error++;
$res = $object->create($user); $res = $object->create($user);
if ($res > 0) if ($res > 0) {
{
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$res); header("Location: ".$_SERVER['PHP_SELF'].'?id='.$res);
exit; exit;
} else { } else {
@ -230,8 +228,7 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $user->rights-
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->delete($user); $result = $object->delete($user);
if ($result > 0) if ($result > 0) {
{
header("Location: index.php"); header("Location: index.php");
exit; exit;
} else { } else {
@ -494,7 +491,7 @@ if ($action == 'create')
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'">'; print '<input type="submit" class="button button-save" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="button" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" onClick="javascript:history.go(-1)">'; print '<input type="button" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" onClick="javascript:history.go(-1)">';
print '</div>'; print '</div>';
@ -546,8 +543,7 @@ if (!empty($id) && $action == 'edit')
print '</td>'; print '</td>';
// Amount // Amount
if ($object->statut == 0) if ($object->statut == 0) {
{
print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" size="10" value="'.price($object->amount).'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>'; print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" size="10" value="'.price($object->amount).'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
} else { } else {
print '<tr><td>'.$langs->trans("Amount").'</td><td>'; print '<tr><td>'.$langs->trans("Amount").'</td><td>';
@ -624,7 +620,7 @@ if (!empty($id) && $action == 'edit')
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
print "</form>\n"; print "</form>\n";
} }

View File

@ -299,7 +299,7 @@ if ($action == 'create')
print "</table>"; print "</table>";
print '<br><div class="center">'; print '<br><div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';

Some files were not shown because too many files have changed in this diff Show More