/**
  *    	Return clicable name (with picto eventually)
  *
  *		@param	int		$withpicto		0=No picto, 1=Include picto into link, 2=Only picto
  *		@param	int		$maxlen			Longueur max libelle
  *		@param	string	$option			Option ('showall')
  *		@return	string					Chaine avec URL
  */
 function getNomUrl($withpicto = 0, $maxlen = 0, $option = '')
 {
     global $langs;
     $result = '';
     $label = $langs->trans("ShowTransaction") . ': ' . $this->rowid;
     $link = '<a href="' . DOL_URL_ROOT . '/compta/bank/ligne.php?rowid=' . $this->rowid . '" title="' . dol_escape_htmltag($label, 1) . '" class="classfortooltip">';
     $linkend = '</a>';
     if ($withpicto) {
         $result .= $link . img_object($label, 'account', 'class="classfortooltip"') . $linkend . ' ';
     }
     $result .= $link . $this->rowid . $linkend;
     if ($option == 'showall' || $option == 'showconciliated') {
         $result .= ' (';
     }
     if ($option == 'showall') {
         $result .= $langs->trans("BankAccount") . ': ';
         $accountstatic = new Account($this->db);
         $accountstatic->id = $this->fk_account;
         $accountstatic->label = $this->bank_account_label;
         $result .= $accountstatic->getNomUrl(0) . ', ';
     }
     if ($option == 'showall' || $option == 'showconciliated') {
         $result .= $langs->trans("BankLineConciliated") . ': ';
         $result .= yn($this->rappro);
     }
     if ($option == 'showall' || $option == 'showconciliated') {
         $result .= ')';
     }
     return $result;
 }
Beispiel #2
0
        // Date
        print "<td align=\"center\" width=\"100\">";
        if ($obj->dc) {
            print dol_print_date($db->jdate($obj->dc), "day");
        } else {
            print "-";
        }
        print '</td>';
        // Delivery date
        print '<td align="right">';
        print dol_print_date($db->jdate($obj->date_livraison), 'day');
        print '</td>';
        // Statut
        print '<td align="right">' . $commandestatic->LibStatut($obj->fk_statut, 5) . '</td>';
        // Billed
        print '<td align="center">' . yn($obj->billed) . '</td>';
        print '<td></td>';
        print "</tr>\n";
        $i++;
    }
    print "</table>\n";
    print "</form>\n";
    if (!empty($conf->facture->enable)) {
        print '<br>' . img_help(1, '') . ' ' . $langs->trans("ToBillSeveralOrderSelectCustomer", $langs->transnoentitiesnoconv("CreateInvoiceForThisCustomer")) . '<br>';
    }
    $db->free($resql);
} else {
    dol_print_error($db);
}
llxFooter();
$db->close();
Beispiel #3
0
         $product_static->id = $objp->rowid;
         $product_static->load_stock();
     }
 }
 // Desired stock
 if (!empty($arrayfields['p.desiredstock']['checked'])) {
     print '<td align="right">';
     if ($objp->fk_product_type != 1) {
         print $objp->desiredstock;
     }
     print '</td>';
 }
 // Desired stock
 if (!empty($arrayfields['p.tobatch']['checked'])) {
     print '<td align="center">';
     print yn($objp->tobatch);
     print '</td>';
 }
 // Stock
 if (!empty($arrayfields['p.stock']['checked'])) {
     print '<td align="right">';
     if ($objp->fk_product_type != 1) {
         if ($product_static->stock_reel < $objp->seuil_stock_alerte) {
             print img_warning($langs->trans("StockTooLow")) . ' ';
         }
         print $product_static->stock_reel;
     }
     print '</td>';
 }
 // Accountancy code sell
 if (!empty($arrayfields['p.accountancy_code_sell']['checked'])) {
print '<td align="right">' . $langs->trans("Size") . '</td>';
print '<td align="center">' . $langs->trans("Unique") . '</td>';
print '<td align="center">' . $langs->trans("Required") . '</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
$var = True;
foreach ($extrafields->attribute_type as $key => $value) {
    $var = !$var;
    print "<tr " . $bc[$var] . ">";
    print "<td>" . $extrafields->attribute_pos[$key] . "</td>\n";
    print "<td>" . $extrafields->attribute_label[$key] . "</td>\n";
    print "<td>" . $key . "</td>\n";
    print "<td>" . $type2label[$extrafields->attribute_type[$key]] . "</td>\n";
    print '<td align="right">' . $extrafields->attribute_size[$key] . "</td>\n";
    print '<td align="center">' . yn($extrafields->attribute_unique[$key]) . "</td>\n";
    print '<td align="center">' . yn($extrafields->attribute_required[$key]) . "</td>\n";
    print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=edit&attrname=' . $key . '">' . img_edit() . '</a>';
    print "&nbsp; <a href=\"" . $_SERVER["PHP_SELF"] . "?action=delete&attrname={$key}\">" . img_delete() . "</a></td>\n";
    print "</tr>";
    // $i++;
}
print "</table>";
dol_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
    print '<div class="tabsAction">';
    print "<a class=\"butAction\" href=\"" . $_SERVER["PHP_SELF"] . "?action=create\">" . $langs->trans("NewAttribute") . "</a>";
    print "</div>";
}
/* ************************************************************************** */
/* */
Beispiel #5
0
 print yn(isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED : 0, 1);
 print '</td></tr>';
 // Link to help center
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("DisableLinkToHelpCenter") . '</td><td colspan="2">';
 print yn(isset($conf->global->MAIN_HELPCENTER_DISABLELINK) ? $conf->global->MAIN_HELPCENTER_DISABLELINK : 0, 1);
 print '</td></tr>';
 // Link to wiki help
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("DisableLinkToHelp", img_picto('', DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/helpdoc.png', '', 1)) . '</td><td colspan="2">';
 print yn(isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
 print '</td></tr>';
 // Show bugtrack link
 $var = !$var;
 print '<tr ' . $bc[$var] . '"><td width="35%">' . $langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")) . '</td><td>';
 print yn($conf->global->MAIN_BUGTRACK_ENABLELINK) . "</td>";
 print '<td width="20">&nbsp;</td>';
 print "</tr>";
 // Message login
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("MessageLogin") . '</td><td colspan="2">';
 if (isset($conf->global->MAIN_HOME)) {
     print dol_htmlcleanlastbr($conf->global->MAIN_HOME);
 } else {
     print '&nbsp;';
 }
 print '</td></tr>' . "\n";
 // Message of the day
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("MessageOfDay") . '</td><td colspan="2">';
 if (isset($conf->global->MAIN_MOTD)) {
Beispiel #6
0
    // Position
    print '<tr><td>' . $langs->trans('Position') . '</td><td><input type="text" size="5" name="position" value="' . $menu->position . '"></td><td>' . $langs->trans('DetailPosition') . '</td></tr>';
    // Target
    print '<tr><td>' . $langs->trans('Target') . '</td><td><select class="flat" name="target">';
    print '<option value=""' . ($menu->target == "" ? ' selected' : '') . '>' . $langs->trans('') . '</option>';
    print '<option value="_blank"' . ($menu->target == "_blank" ? ' selected' : '') . '>' . $langs->trans('_blank') . '</option>';
    print '</select></td><td>' . $langs->trans('DetailTarget') . '</td></tr>';
    // Enabled
    print '<tr><td>' . $langs->trans('Enabled') . '</td><td><input type="text" size="60" name="enabled" value="' . dol_escape_htmltag($menu->enabled) . '"></td><td>' . $langs->trans('DetailEnabled');
    if (!empty($menu->enabled)) {
        print ' (' . $langs->trans("ConditionIsCurrently") . ': ' . yn(dol_eval($menu->enabled, 1)) . ')';
    }
    print '</td></tr>';
    // Perms
    print '<tr><td>' . $langs->trans('Rights') . '</td><td><input type="text" size="60" name="perms" value="' . dol_escape_htmltag($menu->perms) . '"></td><td>' . $langs->trans('DetailRight');
    if (!empty($menu->perms)) {
        print ' (' . $langs->trans("ConditionIsCurrently") . ': ' . yn(dol_eval($menu->perms, 1)) . ')';
    }
    print '</td></tr>';
    print '</table>';
    // Bouton
    print '<br><div class="center">';
    print '<input type="submit" class="button" name="save" value="' . $langs->trans("Save") . '">';
    print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
    print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">';
    print '</div>';
    print '</form>';
    print '<br>';
}
$db->close();
llxFooter();
Beispiel #7
0
 if ($value == 'source') {
     $valuetoshow = isset($sourceList[$valuetoshow]) ? $sourceList[$valuetoshow] : $valuetoshow;
 } else {
     if ($valuetoshow == 'all') {
         $valuetoshow = $langs->trans('All');
     } else {
         if ($fieldlist[$field] == 'country') {
             if (empty($obj->country_code)) {
                 $valuetoshow = '-';
             } else {
                 $key = $langs->trans("Country" . strtoupper($obj->country_code));
                 $valuetoshow = $key != "Country" . strtoupper($obj->country_code) ? $obj->country_code . " - " . $key : $obj->country;
             }
         } else {
             if ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'fdm' || $fieldlist[$field] == 'deductible') {
                 $valuetoshow = yn($valuetoshow);
                 $align = "center";
             } else {
                 if ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) {
                     $valuetoshow = price($valuetoshow);
                 } else {
                     if ($fieldlist[$field] == 'libelle_facture') {
                         $langs->load("bills");
                         $key = $langs->trans("PaymentCondition" . strtoupper($obj->code));
                         $valuetoshow = $obj->code && $key != "PaymentCondition" . strtoupper($obj->code) ? $key : $obj->{$fieldlist}[$field];
                         $valuetoshow = nl2br($valuetoshow);
                     } else {
                         if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX . 'c_country') {
                             $key = $langs->trans("Country" . strtoupper($obj->code));
                             $valuetoshow = $obj->code && $key != "Country" . strtoupper($obj->code) ? $key : $obj->{$fieldlist}[$field];
                         } else {
Beispiel #8
0
 /**
  * Make substitution
  * @param       text        Text to make substitution to
  * @return      string      Value of input text string with substitutions done
  */
 function makeSubstitution($text)
 {
     global $langs;
     $birthday = dol_print_date($this->naiss, 'day');
     $msgishtml = 0;
     if (dol_textishtml($text, 1)) {
         $msgishtml = 1;
     }
     $infos = '';
     if ($this->civilite_id) {
         $infos .= $langs->transnoentities("UserTitle") . ": " . $this->getCivilityLabel(1) . "\n";
     }
     $infos .= $langs->transnoentities("id") . ": " . $this->id . "\n";
     $infos .= $langs->transnoentities("Lastname") . ": " . $this->nom . "\n";
     $infos .= $langs->transnoentities("Firstname") . ": " . $this->prenom . "\n";
     $infos .= $langs->transnoentities("Company") . ": " . $this->societe . "\n";
     $infos .= $langs->transnoentities("Address") . ": " . $this->adresse . "\n";
     $infos .= $langs->transnoentities("Zip") . ": " . $this->cp . "\n";
     $infos .= $langs->transnoentities("Town") . ": " . $this->ville . "\n";
     $infos .= $langs->transnoentities("Country") . ": " . $this->pays . "\n";
     $infos .= $langs->transnoentities("EMail") . ": " . $this->email . "\n";
     $infos .= $langs->transnoentities("Login") . ": " . $this->login . "\n";
     $infos .= $langs->transnoentities("Password") . ": " . $this->pass . "\n";
     $infos .= $langs->transnoentities("Birthday") . ": " . $birthday . "\n";
     $infos .= $langs->transnoentities("Photo") . ": " . $this->photo . "\n";
     $infos .= $langs->transnoentities("Public") . ": " . yn($this->public);
     // Substitutions
     $substitutionarray = array('%DOL_MAIN_URL_ROOT%' => DOL_MAIN_URL_ROOT, '%ID%' => $msgishtml ? dol_htmlentitiesbr($this->id) : $this->id, '%INFOS%' => $msgishtml ? dol_htmlentitiesbr($infos) : $infos, '%CIVILITE%' => $this->getCivilityLabel($msgishtml ? 0 : 1), '%PRENOM%' => $msgishtml ? dol_htmlentitiesbr($this->prenom) : $this->prenom, '%NOM%' => $msgishtml ? dol_htmlentitiesbr($this->nom) : $this->nom, '%SOCIETE%' => $msgishtml ? dol_htmlentitiesbr($this->societe) : $this->societe, '%ADRESSE%' => $msgishtml ? dol_htmlentitiesbr($this->adresse) : $this->adresse, '%CP%' => $msgishtml ? dol_htmlentitiesbr($this->cp) : $this->cp, '%VILLE%' => $msgishtml ? dol_htmlentitiesbr($this->ville) : $this->ville, '%PAYS%' => $msgishtml ? dol_htmlentitiesbr($this->pays) : $this->pays, '%EMAIL%' => $msgishtml ? dol_htmlentitiesbr($this->email) : $this->email, '%NAISS%' => $msgishtml ? dol_htmlentitiesbr($birthday) : $birthday, '%PHOTO%' => $msgishtml ? dol_htmlentitiesbr($this->photo) : $this->photo, '%LOGIN%' => $msgishtml ? dol_htmlentitiesbr($this->login) : $this->login, '%PASSWORD%' => $msgishtml ? dol_htmlentitiesbr($this->pass) : $this->pass);
     complete_substitutions_array($substitutionarray, $langs);
     return make_substitutions($text, $substitutionarray);
 }
    /**
     *      \brief      Return description of module parameters
     *      \param      langs      	Output language
	 *		\param		soc			Third party object
	 *		\param		type		-1=Nothing, 0=Customer, 1=Supplier
	 *		\return		string		HTML translated description
     */
    function getToolTip($langs,$soc,$type)
    {
    	global $conf;

    	$langs->load("admin");

		$s='';
		if ($type == -1) $s.=$langs->trans("Name").': <b>'.$this->nom.'</b><br>';
		if ($type == -1) $s.=$langs->trans("Version").': <b>'.$this->getVersion().'</b><br>';
		if ($type == 0)  $s.=$langs->trans("CustomerCodeDesc").'<br>';
		if ($type == 1)  $s.=$langs->trans("SupplierCodeDesc").'<br>';
		if ($type != -1) $s.=$langs->trans("ValidityControledByModule").': <b>'.$this->getNom($langs).'</b><br>';
		$s.='<br>';
		$s.='<u>'.$langs->trans("ThisIsModuleRules").':</u><br>';
		if ($type == 0)
		{
			$s.=$langs->trans("RequiredIfCustomer").': ';
			if ($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED && !empty($this->code_null)) $s.='<strike>';
			$s.=yn(!$this->code_null,1,2);
			if ($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED && !empty($this->code_null)) $s.='</strike> '.yn(1,1,2).' ('.$langs->trans("ForcedToByAModule",$langs->transnoentities("yes")).')';
			$s.='<br>';
		}
		if ($type == 1)
		{
			$s.=$langs->trans("RequiredIfSupplier").': ';
			if ($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED && !empty($this->code_null)) $s.='<strike>';
			$s.=yn(!$this->code_null,1,2);
			if ($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED && !empty($this->code_null)) $s.='</strike> '.yn(1,1,2).' ('.$langs->trans("ForcedToByAModule",$langs->transnoentities("yes")).')';
			$s.='<br>';
		}
		if ($type == -1)
		{
			$s.=$langs->trans("Required").': ';
			if ($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED && !empty($this->code_null)) $s.='<strike>';
			$s.=yn(!$this->code_null,1,2);
			if ($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED && !empty($this->code_null)) $s.='</strike> '.yn(1,1,2).' ('.$langs->trans("ForcedToByAModule",$langs->transnoentities("yes")).')';
			$s.='<br>';
		}
		$s.=$langs->trans("CanBeModifiedIfOk").': ';
		$s.=yn($this->code_modifiable,1,2);
		$s.='<br>';
		$s.=$langs->trans("CanBeModifiedIfKo").': '.yn($this->code_modifiable_invalide,1,2).'<br>';
		$s.=$langs->trans("AutomaticCode").': '.yn($this->code_auto,1,2).'<br>';
		$s.='<br>';
		if ($type == 0 || $type == -1)
		{
			$nextval=$this->getNextValue($soc,0);
			if (empty($nextval)) $nextval=$langs->trans("Undefined");
			$s.=$langs->trans("NextValue").($type == -1?' ('.$langs->trans("Customer").')':'').': <b>'.$nextval.'</b><br>';
		}
		if ($type == 1 || $type == -1)
		{
			$nextval=$this->getNextValue($soc,1);
			if (empty($nextval)) $nextval=$langs->trans("Undefined");
			$s.=$langs->trans("NextValue").($type == -1?' ('.$langs->trans("Supplier").')':'').': <b>'.$nextval.'</b>';
		}
		return $s;
	}
Beispiel #10
0
                    // Default
                    print '<td align="center">';
                    if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "{$name}") {
                        print img_picto($langs->trans("Default"), 'on');
                    } else {
                        print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&amp;value=' . $name . '&amp;scandir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '&amp;type=order_supplier"" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
                    }
                    print '</td>';
                    // Info
                    $htmltooltip = '' . $langs->trans("Name") . ': ' . $module->name;
                    $htmltooltip .= '<br>' . $langs->trans("Type") . ': ' . ($module->type ? $module->type : $langs->trans("Unknown"));
                    $htmltooltip .= '<br>' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur;
                    $htmltooltip .= '<br><br><u>' . $langs->trans("FeaturesSupported") . ':</u>';
                    $htmltooltip .= '<br>' . $langs->trans("Logo") . ': ' . yn($module->option_logo, 1, 1);
                    $htmltooltip .= '<br>' . $langs->trans("PaymentMode") . ': ' . yn($module->option_modereg, 1, 1);
                    $htmltooltip .= '<br>' . $langs->trans("PaymentConditions") . ': ' . yn($module->option_condreg, 1, 1);
                    print '<td align="center">';
                    print $form->textwithpicto('', $htmltooltip, 1, 0);
                    print '</td>';
                    print '<td align="center">';
                    print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&amp;module=' . $name . '">' . img_object($langs->trans("Preview"), 'order') . '</a>';
                    print '</td>';
                    print "</tr>\n";
                }
            }
            closedir($handle);
        }
    }
}
print '</table><br>';
/*
Beispiel #11
0
     if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) {
         $langs->load("errors");
         $htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
         print ' ' . $form->textwithpicto('', $htmltext, 1, 'warning');
     }
     print '</td></tr>';
 }
 print '</table>';
 print '</div>';
 print '<div class="fichehalfright"><div class="ficheaddleft">';
 print '<div class="underbanner clearboth"></div>';
 print '<table class="border tableforfield" width="100%">';
 // Birthday
 print '<tr><td>' . $langs->trans("Birthday") . '</td><td class="valeur">' . dol_print_date($object->birth, 'day') . '</td></tr>';
 // Public
 print '<tr><td>' . $langs->trans("Public") . '</td><td class="valeur">' . yn($object->public) . '</td></tr>';
 // Categories
 if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
     print '<tr><td>' . $langs->trans("Categories") . '</td>';
     print '<td colspan="2">';
     print $form->showCategories($object->id, 'member', 1);
     print '</td></tr>';
 }
 // Other attributes
 $parameters = array('colspan' => 2);
 $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
 // Note that $action and $object may have been modified by hook
 if (empty($reshook) && !empty($extrafields->attribute_label)) {
     print $object->showOptionals($extrafields, 'view', $parameters);
 }
 // Third party Dolibarr
Beispiel #12
0
    print '<input class="button" type="submit" name="save" value="' . $langs->trans("Save") . '"' . (!count($listofmethods) ? ' disabled="disbaled"' : '') . '>';
    print ' &nbsp; &nbsp; ';
    print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
    print '</center>';
    print '</form>';
    print '<br>';
} else {
    $var = true;
    if (!count($listofmethods)) {
        print '<div class="warning">' . $langs->trans("NoSmsEngine", '<a href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=sms_manager">DoliStore</a>') . '</div>';
    }
    print '<table class="noborder" width="100%">';
    print '<tr class="liste_titre"><td>' . $langs->trans("Parameter") . '</td><td>' . $langs->trans("Value") . '</td></tr>';
    // Disable
    $var = !$var;
    print '<tr ' . $bc[$var] . '><td>' . $langs->trans("MAIN_DISABLE_ALL_SMS") . '</td><td>' . yn($conf->global->MAIN_DISABLE_ALL_SMS) . '</td></tr>';
    // Separator
    $var = !$var;
    print '<tr ' . $bc[$var] . '><td colspan="2">&nbsp;</td></tr>';
    // Method
    $var = !$var;
    print '<tr ' . $bc[$var] . '><td>' . $langs->trans("MAIN_SMS_SENDMODE") . '</td><td>';
    $text = $listofmethods[$conf->global->MAIN_SMS_SENDMODE];
    if (empty($text)) {
        $text = $langs->trans("Undefined") . ' ' . img_warning();
    }
    print $text;
    print '</td></tr>';
    // From
    $var = !$var;
    print '<tr ' . $bc[$var] . '><td>' . $langs->trans("MAIN_MAIL_SMS_FROM", $langs->transnoentities("Undefined")) . '</td>';
Beispiel #13
0
											 	$("input[name=superadmin]")
											 		.attr("disabled", true)
											 		.attr("checked", false);
											 } else {
											 	$("input[name=superadmin]")
											 		.attr("disabled", false);
											 }
										});
									});
								</script>';
                        }
                        $checked = $fuser->admin && !$fuser->entity ? ' checked' : '';
                        print '<input type="checkbox" name="superadmin" value="1"' . $checked . ' /> ' . $langs->trans("SuperAdministrator");
                    }
                } else {
                    $yn = yn($fuser->admin);
                    print '<input type="hidden" name="admin" value="' . $fuser->admin . '">';
                    if (!empty($conf->multicompany->enabled) && !$fuser->entity) {
                        print $html->textwithpicto($yn, $langs->trans("DontDowngradeSuperAdmin"), 1, 'warning');
                    } else {
                        print $yn;
                    }
                }
                print '</td></tr>';
            }
            // Type
            print '<tr><td width="25%" valign="top">' . $langs->trans("Type") . '</td>';
            print '<td>';
            if ($fuser->societe_id) {
                print $langs->trans("External");
            } else {
     print '<td>';
     if (!empty($line->lastresult)) {
         print dol_trunc($line->lastresult);
     } else {
         print $langs->trans('CronNone');
     }
     print '</td>';
     print '<td>';
     if (!empty($line->lastoutput)) {
         print dol_trunc(nl2br($line->lastoutput), 100);
     } else {
         print $langs->trans('CronNone');
     }
     print '</td>';
     print '<td align="center">';
     print yn($line->status);
     print '</td>';
     print '<td align="right">';
     if ($user->rights->cron->delete) {
         print "<a href=\"" . $_SERVER["PHP_SELF"] . "?id=" . $line->id . "&status=" . $status . "&action=delete\" title=\"" . $langs->trans('CronDelete') . "\">" . img_delete() . "</a> &nbsp;";
     } else {
         print "<a href=\"#\" title=\"" . $langs->trans('NotEnoughPermissions') . "\">" . img_delete() . "</a> &nbsp; ";
     }
     if ($user->rights->cron->execute) {
         print "<a href=\"" . $_SERVER["PHP_SELF"] . "?id=" . $line->id . "&status=" . $status . "&action=execute\" title=\"" . $langs->trans('CronExecute') . "\">" . img_picto('', "play") . "</a>";
     } else {
         print "<a href=\"#\" title=\"" . $langs->trans('NotEnoughPermissions') . "\">" . img_picto('', "execute") . "</a>";
     }
     print '</td>';
     print '</tr>';
 }
    /**
     *    Assign custom values for canvas (for example into this->tpl to be used by templates)
     *
     *    @param	string	$action    Type of action
     *    @param	string	$id			Id of object
     *    @param	string	$ref		Ref of object
     *    @return	void
     */
    function assign_values(&$action, $id = 0, $ref = '')
    {
        global $conf, $langs, $user, $mysoc, $canvas;
        global $form, $formadmin, $formcompany;
        if ($action == 'add' || $action == 'update') {
            $this->assign_post($action);
        }
        if ($_GET["type"] == 'f') {
            $this->object->fournisseur = 1;
        }
        if ($_GET["type"] == 'c') {
            $this->object->client = 1;
        }
        if ($_GET["type"] == 'p') {
            $this->object->client = 2;
        }
        if ($_GET["type"] == 'cp') {
            $this->object->client = 3;
        }
        if ($_REQUEST["private"] == 1) {
            $this->object->particulier = 1;
        }
        foreach ($this->object as $key => $value) {
            $this->tpl[$key] = $value;
        }
        $this->tpl['error'] = get_htmloutput_errors($this->object->error, $this->object->errors);
        if (is_array($GLOBALS['errors'])) {
            $this->tpl['error'] = get_htmloutput_mesg('', $GLOBALS['errors'], 'error');
        }
        if ($action == 'create') {
            if ($conf->use_javascript_ajax) {
                $this->tpl['ajax_selecttype'] = "\n" . '<script type="text/javascript" language="javascript">
				$(document).ready(function () {
		              $("#radiocompany").click(function() {
                            document.formsoc.action.value="create";
                            document.formsoc.canvas.value="company";
                            document.formsoc.private.value=0;
                            document.formsoc.submit();
		              });
		               $("#radioprivate").click(function() {
                            document.formsoc.action.value="create";
                            document.formsoc.canvas.value="individual";
                            document.formsoc.private.value=1;
                            document.formsoc.submit();
                      });
		          });
                </script>' . "\n";
            }
        }
        if ($action == 'create' || $action == 'edit') {
            if ($conf->use_javascript_ajax) {
                $this->tpl['ajax_selectcountry'] = "\n" . '<script type="text/javascript" language="javascript">
				$(document).ready(function () {
						$("#selectcountry_id").change(function() {
							document.formsoc.action.value="' . $action . '";
							document.formsoc.canvas.value="' . $canvas . '";
							document.formsoc.submit();
						});
					})
				</script>' . "\n";
            }
            // Load object modCodeClient
            $module = !empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard';
            if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
                $module = substr($module, 0, dol_strlen($module) - 4);
            }
            $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']);
            foreach ($dirsociete as $dirroot) {
                $res = dol_include_once($dirroot . $module . '.php');
                if ($res) {
                    break;
                }
            }
            $modCodeClient = new $module($db);
            $this->tpl['auto_customercode'] = $modCodeClient->code_auto;
            // We verified if the tag prefix is used
            if ($modCodeClient->code_auto) {
                $this->tpl['prefix_customercode'] = $modCodeClient->verif_prefixIsUsed();
            }
            // TODO create a function
            $this->tpl['select_customertype'] = '<select class="flat" name="client">';
            $this->tpl['select_customertype'] .= '<option value="2"' . ($this->object->client == 2 ? ' selected="selected"' : '') . '>' . $langs->trans('Prospect') . '</option>';
            $this->tpl['select_customertype'] .= '<option value="3"' . ($this->object->client == 3 ? ' selected="selected"' : '') . '>' . $langs->trans('ProspectCustomer') . '</option>';
            $this->tpl['select_customertype'] .= '<option value="1"' . ($this->object->client == 1 ? ' selected="selected"' : '') . '>' . $langs->trans('Customer') . '</option>';
            $this->tpl['select_customertype'] .= '<option value="0"' . ($this->object->client == 0 ? ' selected="selected"' : '') . '>' . $langs->trans('NorProspectNorCustomer') . '</option>';
            $this->tpl['select_customertype'] .= '</select>';
            // Customer
            $this->tpl['customercode'] = $this->object->code_client;
            if ((!$this->object->code_client || $this->object->code_client == -1) && $modCodeClient->code_auto) {
                $this->tpl['customercode'] = $modCodeClient->getNextValue($this->object, 0);
            }
            $this->tpl['ismodifiable_customercode'] = $this->object->codeclient_modifiable();
            $s = $modCodeClient->getToolTip($langs, $this->object, 0);
            $this->tpl['help_customercode'] = $form->textwithpicto('', $s, 1);
            if (!empty($conf->fournisseur->enabled)) {
                $this->tpl['supplier_enabled'] = 1;
                // Load object modCodeFournisseur
                $module = $conf->global->SOCIETE_CODECLIENT_ADDON;
                if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
                    $module = substr($module, 0, dol_strlen($module) - 4);
                }
                $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']);
                foreach ($dirsociete as $dirroot) {
                    $res = dol_include_once($dirroot . $module . '.php');
                    if ($res) {
                        break;
                    }
                }
                $modCodeFournisseur = new $module();
                $this->tpl['auto_suppliercode'] = $modCodeFournisseur->code_auto;
                // We verified if the tag prefix is used
                if ($modCodeFournisseur->code_auto) {
                    $this->tpl['prefix_suppliercode'] = $modCodeFournisseur->verif_prefixIsUsed();
                }
                // Supplier
                $this->tpl['yn_supplier'] = $form->selectyesno("fournisseur", $this->object->fournisseur, 1);
                $this->tpl['suppliercode'] = $this->object->code_fournisseur;
                if ((!$this->object->code_fournisseur || $this->object->code_fournisseur == -1) && $modCodeFournisseur->code_auto) {
                    $this->tpl['suppliercode'] = $modCodeFournisseur->getNextValue($this->object, 1);
                }
                $this->tpl['ismodifiable_suppliercode'] = $this->object->codefournisseur_modifiable();
                $s = $modCodeFournisseur->getToolTip($langs, $this->object, 1);
                $this->tpl['help_suppliercode'] = $form->textwithpicto('', $s, 1);
                $this->object->LoadSupplierCateg();
                $this->tpl['suppliercategory'] = $this->object->SupplierCategories;
            }
            // Zip
            $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6);
            // Town
            $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'));
            // Country
            $this->object->country_id = $this->object->country_id ? $this->object->country_id : $mysoc->country_id;
            $this->object->country_code = $this->object->country_code ? $this->object->country_code : $mysoc->country_code;
            $this->tpl['select_country'] = $form->select_country($this->object->country_id, 'country_id');
            $countrynotdefined = $langs->trans("ErrorSetACountryFirst") . ' (' . $langs->trans("SeeAbove") . ')';
            if ($user->admin) {
                $this->tpl['info_admin'] = info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
            }
            // State
            if ($this->object->country_id) {
                $this->tpl['select_state'] = $formcompany->select_state($this->object->state_id, $this->object->country_code);
            } else {
                $this->tpl['select_state'] = $countrynotdefined;
            }
            // Language
            if (!empty($conf->global->MAIN_MULTILANGS)) {
                $this->tpl['select_lang'] = $formadmin->select_language($this->object->default_lang ? $this->object->default_lang : $conf->global->MAIN_LANG_DEFAULT, 'default_lang', 0, 0, 1);
            }
            // VAT
            $this->tpl['yn_assujtva'] = $form->selectyesno('assujtva_value', $this->tpl['tva_assuj'], 1);
            // Assujeti par defaut en creation
            // Select users
            $this->tpl['select_users'] = $form->select_dolusers($this->object->commercial_id, 'commercial_id', 1);
            // Local Tax
            // TODO mettre dans une classe propre au pays
            if ($mysoc->country_code == 'ES') {
                $this->tpl['localtax'] = '';
                if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
                    $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td><td>';
                    $this->tpl['localtax'] .= $form->selectyesno('localtax1assuj_value', $this->object->localtax1_assuj, 1);
                    $this->tpl['localtax'] .= '</td><td>' . $langs->trans("LocalTax2IsUsedES") . '</td><td>';
                    $this->tpl['localtax'] .= $form->selectyesno('localtax2assuj_value', $this->object->localtax1_assuj, 1);
                    $this->tpl['localtax'] .= '</td></tr>';
                } elseif ($mysoc->localtax1_assuj == "1") {
                    $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td><td colspan="3">';
                    $this->tpl['localtax'] .= $form->selectyesno('localtax1assuj_value', $this->object->localtax1_assuj, 1);
                    $this->tpl['localtax'] .= '</td><tr>';
                } elseif ($mysoc->localtax2_assuj == "1") {
                    $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax2IsUsedES") . '</td><td colspan="3">';
                    $this->tpl['localtax'] .= $form->selectyesno('localtax2assuj_value', $this->object->localtax1_assuj, 1);
                    $this->tpl['localtax'] .= '</td><tr>';
                }
            }
        } else {
            $head = societe_prepare_head($this->object);
            $this->tpl['showhead'] = dol_get_fiche_head($head, 'card', '', 0, 'company');
            $this->tpl['showend'] = dol_get_fiche_end();
            $this->tpl['showrefnav'] = $form->showrefnav($this->object, 'socid', '', $user->societe_id ? 0 : 1, 'rowid', 'nom');
            $this->tpl['checkcustomercode'] = $this->object->check_codeclient();
            $this->tpl['checksuppliercode'] = $this->object->check_codefournisseur();
            $this->tpl['address'] = dol_nl2br($this->object->address);
            $img = picto_from_langcode($this->object->country_code);
            if ($this->object->isInEEC()) {
                $this->tpl['country'] = $form->textwithpicto(($img ? $img . ' ' : '') . $this->object->country, $langs->trans("CountryIsInEEC"), 1, 0);
            }
            $this->tpl['country'] = ($img ? $img . ' ' : '') . $this->object->country;
            $this->tpl['phone'] = dol_print_phone($this->object->phone, $this->object->country_code, 0, $this->object->id, 'AC_TEL');
            $this->tpl['fax'] = dol_print_phone($this->object->fax, $this->object->country_code, 0, $this->object->id, 'AC_FAX');
            $this->tpl['email'] = dol_print_email($this->object->email, 0, $this->object->id, 'AC_EMAIL');
            $this->tpl['url'] = dol_print_url($this->object->url);
            $this->tpl['tva_assuj'] = yn($this->object->tva_assuj);
            // Third party type
            $arr = $formcompany->typent_array(1);
            $this->tpl['typent'] = $arr[$this->object->typent_code];
            if (!empty($conf->global->MAIN_MULTILANGS)) {
                require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
                //$s=picto_from_langcode($this->default_lang);
                //print ($s?$s.' ':'');
                $langs->load("languages");
                $this->tpl['default_lang'] = $this->default_lang ? $langs->trans('Language_' . $this->object->default_lang) : '';
            }
            $this->tpl['image_edit'] = img_edit();
            $this->tpl['display_rib'] = $this->object->display_rib();
            // Sales representatives
            $this->tpl['sales_representatives'] = '';
            $listsalesrepresentatives = $this->object->getSalesRepresentatives($user);
            $nbofsalesrepresentative = count($listsalesrepresentatives);
            if ($nbofsalesrepresentative > 3) {
                $this->tpl['sales_representatives'] .= '<a href="' . DOL_URL_ROOT . '/societe/commerciaux.php?socid=' . $this->object->id . '">';
                $this->tpl['sales_representatives'] .= $nbofsalesrepresentative;
                $this->tpl['sales_representatives'] .= '</a>';
            } else {
                if ($nbofsalesrepresentative > 0) {
                    $userstatic = new User($this->db);
                    $i = 0;
                    foreach ($listsalesrepresentatives as $val) {
                        $userstatic->id = $val['id'];
                        $userstatic->lastname = $val['name'];
                        $userstatic->firstname = $val['firstname'];
                        $this->tpl['sales_representatives'] .= $userstatic->getNomUrl(1);
                        $i++;
                        if ($i < $nbofsalesrepresentative) {
                            $this->tpl['sales_representatives'] .= ', ';
                        }
                    }
                } else {
                    $this->tpl['sales_representatives'] .= $langs->trans("NoSalesRepresentativeAffected");
                }
            }
            // Linked member
            if (!empty($conf->adherent->enabled)) {
                $langs->load("members");
                $adh = new Adherent($this->db);
                $result = $adh->fetch('', '', $this->object->id);
                if ($result > 0) {
                    $adh->ref = $adh->getFullName($langs);
                    $this->tpl['linked_member'] = $adh->getNomUrl(1);
                } else {
                    $this->tpl['linked_member'] = $langs->trans("ThirdpartyNotLinkedToMember");
                }
            }
            // Local Tax
            // TODO mettre dans une classe propre au pays
            if ($mysoc->country_code == 'ES') {
                $this->tpl['localtax'] = '';
                if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
                    $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td>';
                    $this->tpl['localtax'] .= '<td>' . yn($this->object->localtax1_assuj) . '</td>';
                    $this->tpl['localtax'] .= '<td>' . $langs->trans("LocalTax2IsUsedES") . '</td>';
                    $this->tpl['localtax'] .= '<td>' . yn($this->object->localtax2_assuj) . '</td></tr>';
                } elseif ($mysoc->localtax1_assuj == "1") {
                    $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td>';
                    $this->tpl['localtax'] .= '<td colspan="3">' . yn($this->object->localtax1_assuj) . '</td></tr>';
                } elseif ($mysoc->localtax2_assuj == "1") {
                    $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax2IsUsedES") . '</td>';
                    $this->tpl['localtax'] .= '<td colspan="3">' . yn($this->object->localtax2_assuj) . '</td></tr>';
                }
            }
        }
    }
Beispiel #16
0
 $head = member_type_prepare_head($object);
 dol_fiche_head($head, 'card', $langs->trans("MemberType"), 0, 'group');
 print '<table class="border" width="100%">';
 $linkback = '<a href="' . DOL_URL_ROOT . '/adherents/type.php">' . $langs->trans("BackToList") . '</a>';
 // Ref
 print '<tr><td width="15%">' . $langs->trans("Ref") . '</td>';
 print '<td>';
 print $form->showrefnav($object, 'rowid', $linkback);
 print '</td></tr>';
 // Label
 print '<tr><td width="15%">' . $langs->trans("Label") . '</td><td>' . dol_escape_htmltag($object->libelle) . '</td></tr>';
 print '<tr><td>' . $langs->trans("SubscriptionRequired") . '</td><td>';
 print yn($object->cotisation);
 print '</tr>';
 print '<tr><td>' . $langs->trans("VoteAllowed") . '</td><td>';
 print yn($object->vote);
 print '</tr>';
 print '<tr><td valign="top">' . $langs->trans("Description") . '</td><td>';
 print nl2br($object->note) . "</td></tr>";
 print '<tr><td valign="top">' . $langs->trans("WelcomeEMail") . '</td><td>';
 print nl2br($object->mail_valid) . "</td></tr>";
 // Other attributes
 $parameters = array();
 $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $act, $action);
 // Note that $action and $object may have been modified by hook
 if (empty($reshook) && !empty($extrafields->attribute_label)) {
     // View extrafields
     print $object->showOptionals($extrafields);
 }
 print '</table>';
 dol_fiche_end();
Beispiel #17
0
    // Show prof id 2 in address into pdf
    $var=!$var;
    print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId2",$mysoc->pays_code).'</td><td>';
    print yn($conf->global->MAIN_PROFID2_IN_ADDRESS,1);
    print '</td></tr>';

    // Show prof id 3 in address into pdf
    $var=!$var;
    print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId3",$mysoc->pays_code).'</td><td>';
    print yn($conf->global->MAIN_PROFID3_IN_ADDRESS,1);
    print '</td></tr>';

    // Show prof id 4 in address into pdf
    $var=!$var;
    print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId4",$mysoc->pays_code).'</td><td>';
    print yn($conf->global->MAIN_PROFID4_IN_ADDRESS,1);
    print '</td></tr>';

    print '</table>'."\n";


    print '<div class="tabsAction">';
    print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
    print '</div>';
	print '<br>';
}


$db->close();

llxFooter('$Date: 2011/07/31 22:23:24 $ - $Revision: 1.130 $');
Beispiel #18
0
    print '<tr class="liste_titre">';
    print '<td>' . $langs->trans("Line") . '</td><td>' . $langs->trans("ThirdParty") . '</td><td align="right">' . $langs->trans("Amount") . '</td>';
    print '<td>' . $langs->trans("Reason") . '</td><td align="center">' . $langs->trans("ToBill") . '</td><td align="center">' . $langs->trans("Invoice") . '</td></tr>';
    $var = True;
    $total = 0;
    while ($i < $num) {
        $obj = $db->fetch_object($resql);
        print "<tr {$bc[$var]}><td>";
        print '<img border="0" src="./img/statut' . $obj->statut . '.png"></a>&nbsp;';
        print '<a href="' . DOL_URL_ROOT . '/compta/prelevement/ligne.php?id=' . $obj->rowid . '">';
        print substr('000000' . $obj->rowid, -6);
        print '</a></td>';
        print '<td><a href="' . DOL_URL_ROOT . '/comm/fiche.php?socid=' . $obj->socid . '">' . stripslashes($obj->nom) . "</a></td>\n";
        print '<td align="right">' . price($obj->amount) . "</td>\n";
        print '<td>' . $rej->motifs[$obj->motif] . '</td>';
        print '<td align="center">' . yn($obj->afacturer) . '</td>';
        print '<td align="center">' . $obj->fk_facture . '</td>';
        print "</tr>\n";
        $total += $obj->amount;
        $var = !$var;
        $i++;
    }
    print '<tr class="liste_total"><td>&nbsp;</td>';
    print '<td class="liste_total">' . $langs->trans("Total") . '</td>';
    print '<td align="right">' . price($total) . "</td>\n";
    print '<td>&nbsp;</td>';
    print "</tr>\n</table>\n";
    $db->free($resql);
} else {
    dol_print_error($db);
}
Beispiel #19
0
 // Local Taxes
 if ($mysoc->pays_code == 'ES') {
     if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
         print '<tr><td nowrap="nowrap">' . $langs->trans('LocalTax1IsUsedES') . '</td><td colspan="3">';
         print yn($objsoc->localtax1_assuj);
         print '</td></tr>';
         print '<tr><td nowrap="nowrap">' . $langs->trans('LocalTax2IsUsedES') . '</td><td colspan="3">';
         print yn($objsoc->localtax2_assuj);
         print '</td></tr>';
     } elseif ($mysoc->localtax1_assuj == "1") {
         print '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td><td colspan="3">';
         print yn($objsoc->localtax1_assuj);
         print '</td></tr>';
     } elseif ($mysoc->localtax2_assuj == "1") {
         print '<tr><td>' . $langs->trans("LocalTax2IsUsedES") . '</td><td colspan="3">';
         print yn($objsoc->localtax2_assuj);
         print '</td></tr>';
     }
 }
 // TVA Intra
 print '<tr><td nowrap>' . $langs->trans('VATIntraVeryShort') . '</td><td colspan="3">';
 print $objsoc->tva_intra;
 print '</td></tr>';
 // Conditions de reglement par defaut
 $langs->load('bills');
 $html = new Form($db);
 print '<tr><td nowrap>';
 print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
 print $langs->trans('PaymentConditions');
 print '<td>';
 if ($_GET['action'] != 'editconditions' && $user->rights->societe->creer) {
Beispiel #20
0
                print "<td align=\"center\">";
                if ($conf->global->DON_ADDON_MODEL == "{$name}") {
                    print img_picto($langs->trans("Default"), 'on');
                } else {
                    print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&amp;value=' . $name . '&amp;scandir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
                }
                print '</td>';
                // Info
                $htmltooltip = '' . $langs->trans("Name") . ': ' . $module->name;
                $htmltooltip .= '<br>' . $langs->trans("Type") . ': ' . ($module->type ? $module->type : $langs->trans("Unknown"));
                if ($module->type == 'pdf') {
                    $htmltooltip .= '<br>' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur;
                }
                $htmltooltip .= '<br><br><u>' . $langs->trans("FeaturesSupported") . ':</u>';
                $htmltooltip .= '<br>' . $langs->trans("Logo") . ': ' . yn($module->option_logo, 1, 1);
                $htmltooltip .= '<br>' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang, 1, 1);
                print '<td align="center">';
                print $form->textwithpicto('', $htmltooltip, -1, 0);
                print '</td>';
                // Preview
                print '<td align="center">';
                print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '" target="specimen">' . img_object($langs->trans("Preview"), 'generic') . '</a>';
                print '</td>';
                print "</tr>\n";
            }
        }
    }
    closedir($handle);
}
print '</table>';
print "<br>";
     $nbrows++;
 }
 // Ref
 print "<tr>" . '<td>' . $langs->trans("Ref") . '</td><td colspan="2">';
 print $form->showrefnav($don, 'rowid', $linkback, 1, 'rowid', 'ref', '');
 print '</td>';
 print '</tr>';
 // Date
 print '<tr><td width="25%">' . $langs->trans("Date") . '</td><td>';
 print dol_print_date($don->date, "day");
 print "</td>";
 print '<td rowspan="' . $nbrows . '" valign="top" width="50%">' . $langs->trans("Comments") . ' :<br>';
 print nl2br($don->note_private) . '</td></tr>';
 print "<tr>" . '<td>' . $langs->trans("Amount") . '</td><td>' . price($don->amount, 0, $langs, 0, 0, -1, $conf->currency) . '</td></tr>';
 print "<tr><td>" . $langs->trans("PublicDonation") . "</td><td>";
 print yn($don->public);
 print "</td></tr>\n";
 print "<tr>" . '<td>' . $langs->trans("Company") . '</td><td>' . $don->societe . '</td></tr>';
 print "<tr>" . '<td>' . $langs->trans("Firstname") . '</td><td>' . $don->firstname . '</td></tr>';
 print "<tr>" . '<td>' . $langs->trans("Lastname") . '</td><td>' . $don->lastname . '</td></tr>';
 print "<tr>" . '<td>' . $langs->trans("Address") . '</td><td>' . dol_nl2br($don->address) . '</td></tr>';
 // Zip / Town
 print "<tr>" . '<td>' . $langs->trans("Zip") . ' / ' . $langs->trans("Town") . '</td><td>' . $don->zip . ($don->zip && $don->town ? ' / ' : '') . $don->town . '</td></tr>';
 // Country
 print "<tr>" . '<td>' . $langs->trans("Country") . '</td><td>' . $don->country . '</td></tr>';
 // EMail
 print "<tr>" . '<td>' . $langs->trans("EMail") . '</td><td>' . dol_print_email($don->email) . '</td></tr>';
 // Payment mode
 print "<tr><td>" . $langs->trans("PaymentMode") . "</td><td>";
 print $form->form_modes_reglement(null, $don->modepaiementid, 'none');
 print "</td></tr>\n";
Beispiel #22
0
" />
								<br/><br/><br/> <button type="submit" class="btn btn-primary">Додати</button>
										</div>
						</div>
				</form>
						<?php 
}
?>
            <?php 
$test_type = $data[0]['test_type'];
if ($test_type == 'many') {
    multiple($test_type, $t_id, $question_id, $data);
} elseif ($test_type == 'one') {
    single($test_type, $t_id, $question_id, $data);
} elseif ($test_type == 'yn') {
    yn($test_type, 2, $t_id, $question_id, $data);
} elseif ($test_type == 'text') {
    text($test_type, $t_id, $question_id, $data);
} elseif ($test_type == 'order') {
    order($test_type, $t_id, $question_id, $data);
}
?>
            <div class="col-xs-9 col-sm-8 col-md-6 col-lg-4 col-xs-offset-3 col-sm-offset-2 col-md-offset-2 col-lg-offset-2">
                <a href="<?php 
print URL;
?>
?c=manageTests&f=create_question_hand">назад</a>
            </div>
        </div></div></div>
</div>
</div>
Beispiel #23
0
llxHeader();
print_fiche_titre("XCache", '', 'title_setup');
print "<br>\n";
//function_exists('apc_cache_info') || function_exists('eaccelerator_info') || function_exists('xcache_info'))
if (!function_exists('xcache_info')) {
    print 'XCache seems to be not installed. Function xcache_info not found.';
    llxFooter();
    exit;
}
print 'Opcode cache XCache is on<br><br>' . "\n\n";
print $langs->trans("Split") . ': ' . ini_get('xcache.count') . ' &nbsp; &nbsp; &nbsp; ' . $langs->trans("Recommanded") . ': (cat /proc/cpuinfo | grep -c processor) + 1<br>' . "\n";
print $langs->trans("Size") . ': ' . ini_get('xcache.size') . ' &nbsp; &nbsp; &nbsp; ' . $langs->trans("Recommanded") . ': 16*Split<br>' . "\n";
print $langs->trans("xcache.cacher") . ': ' . yn(ini_get('xcache.cacher')) . '<br>' . "\n";
print $langs->trans("xcache.optimizer") . ': ' . yn(ini_get('xcache.optimizer')) . ' (will be usefull only with xcache v2)<br>' . "\n";
print $langs->trans("xcache.stat") . ': ' . yn(ini_get('xcache.stat')) . '<br>' . "\n";
print $langs->trans("xcache.coverager") . ': ' . yn(ini_get('xcache.coverager')) . '<br>' . "\n";
//print xcache_get();
/*
$cacheinfos = array();
for ($i = 0; $i < 10; $i ++)
{
    $data = xcache_info(XC_TYPE_PHP, $i);
    $data['cacheid'] = $i;
    $cacheinfos[] = $data;
}

var_dump($cacheinfos);

if ($action == 'clear')
{
    xcache_clear_cache();
Beispiel #24
0
                }
                if ($objp->num_releve) {
                    print ' &nbsp; (<a href="' . DOL_URL_ROOT . '/compta/bank/releve.php?num=' . $objp->num_releve . '&account=' . $acct->id . '">' . $langs->trans("AccountStatement") . ' ' . $objp->num_releve . ')</a>';
                }
                print '</td><td align="center" rowspan="2" width="20%"><input type="submit" class="button" value="' . $langs->trans("Update") . '"></td>';
            } else {
                print '<td colspan="4">' . $objp->num_releve . '&nbsp;</td>';
            }
            print '</tr>';
            print "<tr><td>" . $langs->trans("BankLineConciliated") . "</td>";
            if ($user->rights->banque->consolidate) {
                print '<td colspan="3">';
                print '<input type="checkbox" name="reconciled" class="flat" ' . (isset($_POST["reconciled"]) ? $_POST["reconciled"] ? ' checked="checked"' : '' : ($objp->rappro ? ' checked="checked"' : '')) . '">';
                print '</td>';
            } else {
                print '<td colspan="4">' . yn($objp->rappro) . '</td>';
            }
            print '</tr>';
            print '</table></form>';
        }
    }
    $db->free($result);
} else {
    dol_print_error($db);
}
print '</div>';
// List of bank categories
print '<br>';
print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '?rowid=' . $rowid . '&amp;id=' . $id . '">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="class">';
Beispiel #25
0
 }
 // Affichage fiche action en mode visu
 print '<table class="border" width="100%">';
 $linkback = '<a href="' . DOL_URL_ROOT . '/comm/action/listactions.php">' . $langs->trans("BackToList") . '</a>';
 // Ref
 print '<tr><td width="30%">' . $langs->trans("Ref") . '</td><td colspan="3">';
 print $form->showrefnav($object, 'id', $linkback, $user->societe_id ? 0 : 1, 'id', 'ref', '');
 print '</td></tr>';
 // Type
 if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
     print '<tr><td>' . $langs->trans("Type") . '</td><td colspan="3">' . $object->type . '</td></tr>';
 }
 // Title
 print '<tr><td>' . $langs->trans("Title") . '</td><td colspan="3">' . dol_htmlentities($object->label) . '</td></tr>';
 // Full day event
 print '<tr><td>' . $langs->trans("EventOnFullDay") . '</td><td colspan="3">' . yn($object->fulldayevent, 3) . '</td></tr>';
 $rowspan = 4;
 if (empty($conf->global->AGENDA_DISABLE_LOCATION)) {
     $rowspan++;
 }
 // Date start
 print '<tr><td width="30%">' . $langs->trans("DateActionStart") . '</td><td colspan="3">';
 if (!$object->fulldayevent) {
     print dol_print_date($object->datep, 'dayhour');
 } else {
     print dol_print_date($object->datep, 'day');
 }
 if ($object->percentage == 0 && $object->datep && $object->datep < $now - $delay_warning) {
     print img_warning($langs->trans("Late"));
 }
 print '</td>';
 /**
  *      Build an input field used to filter the query
  *
  *      @param		string	$TypeField		Type of Field to filter
  *      @param		string	$NameField		Name of the field to filter
  *      @param		string	$ValueField		Initial value of the field to filter
  *      @return		string					html string of the input field ex : "<input type=text name=... value=...>"
  */
 function build_filterField($TypeField, $NameField, $ValueField)
 {
     $szFilterField = '';
     $InfoFieldList = explode(":", $TypeField);
     // build the input field on depend of the type of file
     switch ($InfoFieldList[0]) {
         case 'Text':
         case 'Date':
         case 'Duree':
         case 'Numeric':
             $szFilterField = '<input type="text" name=' . $NameField . " value='" . $ValueField . "'>";
             break;
         case 'Boolean':
             $szFilterField = '<select name="' . $NameField . '" class="flat">';
             $szFilterField .= '<option ';
             if ($ValueField == '') {
                 $szFilterField .= ' selected ';
             }
             $szFilterField .= ' value="">&nbsp;</option>';
             $szFilterField .= '<option ';
             if ($ValueField == 'yes') {
                 $szFilterField .= ' selected ';
             }
             $szFilterField .= ' value="yes">' . yn(1) . '</option>';
             $szFilterField .= '<option ';
             if ($ValueField == 'no') {
                 $szFilterField .= ' selected ';
             }
             $szFilterField .= ' value="no">' . yn(0) . '</option>';
             $szFilterField .= "</select>";
             break;
         case 'List':
             // 0 : Type du champ
             // 1 : Nom de la table
             // 2 : Nom du champ contenant le libelle
             // 3 : Nom du champ contenant la cle (si different de rowid)
             if (count($InfoFieldList) == 4) {
                 $keyList = $InfoFieldList[3];
             } else {
                 $keyList = 'rowid';
             }
             $sql = 'SELECT ' . $keyList . ' as rowid, ' . $InfoFieldList[2];
             $sql .= ' FROM ' . MAIN_DB_PREFIX . $InfoFieldList[1];
             $resql = $this->db->query($sql);
             if ($resql) {
                 $szFilterField = '<select class="flat" name="' . $NameField . '">';
                 $szFilterField .= '<option value="0">&nbsp;</option>';
                 $num = $this->db->num_rows($resql);
                 $i = 0;
                 if ($num) {
                     while ($i < $num) {
                         $obj = $this->db->fetch_object($resql);
                         if ($obj->{$InfoFieldList}[2] == '-') {
                             // Discard entry '-'
                             $i++;
                             continue;
                         }
                         $labeltoshow = dol_trunc($obj->{$InfoFieldList}[2], 18);
                         if (!empty($ValueField) && $ValueField == $obj->rowid) {
                             $szFilterField .= '<option value="' . $obj->rowid . '" selected="selected">' . $labeltoshow . '</option>';
                         } else {
                             $szFilterField .= '<option value="' . $obj->rowid . '" >' . $labeltoshow . '</option>';
                         }
                         $i++;
                     }
                 }
                 $szFilterField .= "</select>";
                 $this->db->free();
             }
             break;
     }
     return $szFilterField;
 }
Beispiel #27
0
                print yn($object->localtax1_assuj);
                print '</td><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td>';
                print yn($object->localtax2_assuj);
                print '</td></tr>';

            }
            elseif($mysoc->localtax1_assuj=="1")
            {
                print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">';
                print yn($object->localtax1_assuj);
                print '</td><tr>';
            }
            elseif($mysoc->localtax2_assuj=="1")
            {
                print '<tr><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">';
                print yn($object->localtax2_assuj);
                print '</td><tr>';
            }
        }

        // Type + Staff
        $arr = $formcompany->typent_array(1);
        $object->typent= $arr[$object->typent_code];
        print '<tr><td>'.$langs->trans("ThirdPartyType").'</td><td>'.$object->typent.'</td><td>'.$langs->trans("Staff").'</td><td>'.$object->effectif.'</td></tr>';

        // Legal
        print '<tr><td>'.$langs->trans('JuridicalStatus').'</td><td colspan="3">'.$object->forme_juridique.'</td></tr>';

        // Capital
        print '<tr><td>'.$langs->trans('Capital').'</td><td colspan="3">';
        if ($object->capital) print $object->capital.' '.$langs->trans("Currency".$conf->currency);
 /**
  *	Get the form to input an email
  *  this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
  *
  *	@param	string	$addfileaction		Name of action when posting file attachments
  *	@param	string	$removefileaction	Name of action when removing file attachments
  *	@return string						Form to show
  */
 function get_form($addfileaction = 'addfile', $removefileaction = 'removefile')
 {
     global $conf, $langs, $user, $hookmanager, $form;
     if (!is_object($form)) {
         $form = new Form($this->db);
     }
     $langs->load("other");
     $langs->load("mails");
     $hookmanager->initHooks(array('formmail'));
     $parameters = array('addfileaction' => $addfileaction, 'removefileaction' => $removefileaction);
     $reshook = $hookmanager->executeHooks('getFormMail', $parameters, $this);
     if (!empty($reshook)) {
         return $hookmanager->resPrint;
     } else {
         $out = '';
         // Define list of attached files
         $listofpaths = array();
         $listofnames = array();
         $listofmimes = array();
         if (!empty($_SESSION["listofpaths"])) {
             $listofpaths = explode(';', $_SESSION["listofpaths"]);
         }
         if (!empty($_SESSION["listofnames"])) {
             $listofnames = explode(';', $_SESSION["listofnames"]);
         }
         if (!empty($_SESSION["listofmimes"])) {
             $listofmimes = explode(';', $_SESSION["listofmimes"]);
         }
         $out .= "\n<!-- Debut form mail -->\n";
         if ($this->withform == 1) {
             $out .= '<form method="POST" name="mailform" enctype="multipart/form-data" action="' . $this->param["returnurl"] . '">' . "\n";
             $out .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '" />';
         }
         foreach ($this->param as $key => $value) {
             $out .= '<input type="hidden" id="' . $key . '" name="' . $key . '" value="' . $value . '" />' . "\n";
         }
         $out .= '<table class="border" width="100%">' . "\n";
         // Substitution array
         if (!empty($this->withsubstit)) {
             $out .= '<tr><td colspan="2">';
             $help = "";
             foreach ($this->substit as $key => $val) {
                 $help .= $key . ' -> ' . $langs->trans($val) . '<br>';
             }
             $out .= $form->textwithpicto($langs->trans("EMailTestSubstitutionReplacedByGenericValues"), $help);
             $out .= "</td></tr>\n";
         }
         // From
         if (!empty($this->withfrom)) {
             if (!empty($this->withfromreadonly)) {
                 $out .= '<input type="hidden" id="fromname" name="fromname" value="' . $this->fromname . '" />';
                 $out .= '<input type="hidden" id="frommail" name="frommail" value="' . $this->frommail . '" />';
                 $out .= '<tr><td width="180">' . $langs->trans("MailFrom") . '</td><td>';
                 if ($this->fromtype == 'user' && $this->fromid > 0) {
                     $langs->load("users");
                     $fuser = new User($this->db);
                     $fuser->fetch($this->fromid);
                     $out .= $fuser->getNomUrl(1);
                 } else {
                     $out .= $this->fromname;
                 }
                 if ($this->frommail) {
                     $out .= " &lt;" . $this->frommail . "&gt;";
                 } else {
                     if ($this->fromtype) {
                         $langs->load("errors");
                         $out .= '<font class="warning"> &lt;' . $langs->trans("ErrorNoMailDefinedForThisUser") . '&gt; </font>';
                     }
                 }
                 $out .= "</td></tr>\n";
                 $out .= "</td></tr>\n";
             } else {
                 $out .= "<tr><td>" . $langs->trans("MailFrom") . "</td><td>";
                 $out .= $langs->trans("Name") . ':<input type="text" id="fromname" name="fromname" size="32" value="' . $this->fromname . '" />';
                 $out .= '&nbsp; &nbsp; ';
                 $out .= $langs->trans("EMail") . ':&lt;<input type="text" id="frommail" name="frommail" size="32" value="' . $this->frommail . '" />&gt;';
                 $out .= "</td></tr>\n";
             }
         }
         // Replyto
         if (!empty($this->withreplyto)) {
             if ($this->withreplytoreadonly) {
                 $out .= '<input type="hidden" id="replyname" name="replyname" value="' . $this->replytoname . '" />';
                 $out .= '<input type="hidden" id="replymail" name="replymail" value="' . $this->replytomail . '" />';
                 $out .= "<tr><td>" . $langs->trans("MailReply") . "</td><td>" . $this->replytoname . ($this->replytomail ? " &lt;" . $this->replytomail . "&gt;" : "");
                 $out .= "</td></tr>\n";
             }
         }
         // Errorsto
         if (!empty($this->witherrorsto)) {
             //if (! $this->errorstomail) $this->errorstomail=$this->frommail;
             $errorstomail = !empty($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : $this->errorstomail;
             if ($this->witherrorstoreadonly) {
                 $out .= '<input type="hidden" id="errorstomail" name="errorstomail" value="' . $errorstomail . '" />';
                 $out .= '<tr><td>' . $langs->trans("MailErrorsTo") . '</td><td>';
                 $out .= $errorstomail;
                 $out .= "</td></tr>\n";
             } else {
                 $out .= '<tr><td>' . $langs->trans("MailErrorsTo") . '</td><td>';
                 $out .= '<input size="30" id="errorstomail" name="errorstomail" value="' . $errorstomail . '" />';
                 $out .= "</td></tr>\n";
             }
         }
         // To
         if (!empty($this->withto) || is_array($this->withto)) {
             $out .= '<tr><td width="180">';
             if ($this->withtofree) {
                 $out .= $form->textwithpicto($langs->trans("MailTo"), $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"));
             } else {
                 $out .= $langs->trans("MailTo");
             }
             $out .= '</td><td>';
             if ($this->withtoreadonly) {
                 if (!empty($this->toname) && !empty($this->tomail)) {
                     $out .= '<input type="hidden" id="toname" name="toname" value="' . $this->toname . '" />';
                     $out .= '<input type="hidden" id="tomail" name="tomail" value="' . $this->tomail . '" />';
                     if ($this->totype == 'thirdparty') {
                         $soc = new Societe($this->db);
                         $soc->fetch($this->toid);
                         $out .= $soc->getNomUrl(1);
                     } else {
                         if ($this->totype == 'contact') {
                             $contact = new Contact($this->db);
                             $contact->fetch($this->toid);
                             $out .= $contact->getNomUrl(1);
                         } else {
                             $out .= $this->toname;
                         }
                     }
                     $out .= ' &lt;' . $this->tomail . '&gt;';
                     if ($this->withtofree) {
                         $out .= '<br>' . $langs->trans("or") . ' <input size="' . (is_array($this->withto) ? "30" : "60") . '" id="sendto" name="sendto" value="' . (!is_array($this->withto) && !is_numeric($this->withto) ? isset($_REQUEST["sendto"]) ? $_REQUEST["sendto"] : $this->withto : "") . '" />';
                     }
                 } else {
                     $out .= !is_array($this->withto) && !is_numeric($this->withto) ? $this->withto : "";
                 }
             } else {
                 if (!empty($this->withtofree)) {
                     $out .= '<input size="' . (is_array($this->withto) ? "30" : "60") . '" id="sendto" name="sendto" value="' . (!is_array($this->withto) && !is_numeric($this->withto) ? isset($_REQUEST["sendto"]) ? $_REQUEST["sendto"] : $this->withto : "") . '" />';
                 }
                 if (!empty($this->withto) && is_array($this->withto)) {
                     if (!empty($this->withtofree)) {
                         $out .= " " . $langs->trans("or") . " ";
                     }
                     $out .= $form->selectarray("receiver", $this->withto, GETPOST("receiver"), 1);
                 }
                 if (isset($this->withtosocid) && $this->withtosocid > 0) {
                     $liste = array();
                     $soc = new Societe($this->db);
                     $soc->fetch($this->withtosocid);
                     foreach ($soc->thirdparty_and_contact_email_array(1) as $key => $value) {
                         $liste[$key] = $value;
                     }
                     if ($this->withtofree) {
                         $out .= " " . $langs->trans("or") . " ";
                     }
                     $out .= $form->selectarray("receiver", $liste, GETPOST("receiver"), 1);
                 }
             }
             $out .= "</td></tr>\n";
         }
         // CC
         if (!empty($this->withtocc) || is_array($this->withtocc)) {
             $out .= '<tr><td width="180">';
             $out .= $form->textwithpicto($langs->trans("MailCC"), $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"));
             $out .= '</td><td>';
             if ($this->withtoccreadonly) {
                 $out .= !is_array($this->withtocc) && !is_numeric($this->withtocc) ? $this->withtocc : "";
             } else {
                 $out .= '<input size="' . (is_array($this->withtocc) ? "30" : "60") . '" id="sendtocc" name="sendtocc" value="' . (!is_array($this->withtocc) && !is_numeric($this->withtocc) ? isset($_POST["sendtocc"]) ? $_POST["sendtocc"] : $this->withtocc : (isset($_POST["sendtocc"]) ? $_POST["sendtocc"] : "")) . '" />';
                 if (!empty($this->withtocc) && is_array($this->withtocc)) {
                     $out .= " " . $langs->trans("or") . " ";
                     $out .= $form->selectarray("receivercc", $this->withtocc, GETPOST("receivercc"), 1);
                 }
             }
             $out .= "</td></tr>\n";
         }
         // CCC
         if (!empty($this->withtoccc) || is_array($this->withtoccc)) {
             $out .= '<tr><td width="180">';
             $out .= $form->textwithpicto($langs->trans("MailCCC"), $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"));
             $out .= '</td><td>';
             if (!empty($this->withtocccreadonly)) {
                 $out .= !is_array($this->withtoccc) && !is_numeric($this->withtoccc) ? $this->withtoccc : "";
             } else {
                 $out .= '<input size="' . (is_array($this->withtoccc) ? "30" : "60") . '" id="sendtoccc" name="sendtoccc" value="' . (!is_array($this->withtoccc) && !is_numeric($this->withtoccc) ? isset($_POST["sendtoccc"]) ? $_POST["sendtoccc"] : $this->withtoccc : (isset($_POST["sendtoccc"]) ? $_POST["sendtoccc"] : "")) . '" />';
                 if (!empty($this->withtoccc) && is_array($this->withtoccc)) {
                     $out .= " " . $langs->trans("or") . " ";
                     $out .= $form->selectarray("receiverccc", $this->withtoccc, GETPOST("receiverccc"), 1);
                 }
             }
             //if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print ' '.info_admin("+ ".$conf->global->MAIN_MAIL_AUTOCOPY_TO,1);
             $out .= "</td></tr>\n";
         }
         // Ask delivery receipt
         if (!empty($this->withdeliveryreceipt)) {
             $out .= '<tr><td width="180">' . $langs->trans("DeliveryReceipt") . '</td><td>';
             if (!empty($this->withdeliveryreceiptreadonly)) {
                 $out .= yn($this->withdeliveryreceipt);
             } else {
                 $out .= $form->selectyesno('deliveryreceipt', isset($_POST["deliveryreceipt"]) ? $_POST["deliveryreceipt"] : 0, 1);
             }
             $out .= "</td></tr>\n";
         }
         // Topic
         if (!empty($this->withtopic)) {
             $this->withtopic = make_substitutions($this->withtopic, $this->substit);
             $out .= '<tr>';
             $out .= '<td width="180">' . $langs->trans("MailTopic") . '</td>';
             $out .= '<td>';
             if ($this->withtopicreadonly) {
                 $out .= $this->withtopic;
                 $out .= '<input type="hidden" size="60" id="subject" name="subject" value="' . $this->withtopic . '" />';
             } else {
                 $out .= '<input type="text" size="60" id="subject" name="subject" value="' . (isset($_POST["subject"]) ? $_POST["subject"] : (is_numeric($this->withtopic) ? '' : $this->withtopic)) . '" />';
             }
             $out .= "</td></tr>\n";
         }
         // Attached files
         if (!empty($this->withfile)) {
             $out .= '<tr>';
             $out .= '<td width="180">' . $langs->trans("MailFile") . '</td>';
             $out .= '<td>';
             if (is_numeric($this->withfile)) {
                 // TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript
                 $out .= '<input type="hidden" class="removedfilehidden" name="removedfile" value="">' . "\n";
                 $out .= '<script type="text/javascript" language="javascript">';
                 $out .= 'jQuery(document).ready(function () {';
                 $out .= '    jQuery(".removedfile").click(function() {';
                 $out .= '        jQuery(".removedfilehidden").val(jQuery(this).val());';
                 $out .= '    });';
                 $out .= '})';
                 $out .= '</script>' . "\n";
                 if (count($listofpaths)) {
                     foreach ($listofpaths as $key => $val) {
                         $out .= '<div id="attachfile_' . $key . '">';
                         $out .= img_mime($listofnames[$key]) . ' ' . $listofnames[$key];
                         if (!$this->withfilereadonly) {
                             $out .= ' <input type="image" style="border: 0px;" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/delete.png" value="' . ($key + 1) . '" class="removedfile" id="removedfile_' . $key . '" name="removedfile_' . $key . '" />';
                             //$out.= ' <a href="'.$_SERVER["PHP_SELF"].'?removedfile='.($key+1).' id="removedfile_'.$key.'">'.img_delete($langs->trans("Delete").'</a>';
                         }
                         $out .= '<br></div>';
                     }
                 } else {
                     $out .= $langs->trans("NoAttachedFiles") . '<br>';
                 }
                 if ($this->withfile == 2) {
                     $out .= '<input type="file" class="flat" id="addedfile" name="addedfile" value="' . $langs->trans("Upload") . '" />';
                     $out .= ' ';
                     $out .= '<input type="submit" class="button" id="' . $addfileaction . '" name="' . $addfileaction . '" value="' . $langs->trans("MailingAddFile") . '" />';
                 }
             } else {
                 $out .= $this->withfile;
             }
             $out .= "</td></tr>\n";
         }
         // Message
         if (!empty($this->withbody)) {
             $defaultmessage = "";
             // TODO    A partir du type, proposer liste de messages dans table llx_c_email_template
             if ($this->param["models"] == 'facture_send') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentSendInvoice");
             } elseif ($this->param["models"] == 'facture_relance') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentSendInvoiceReminder");
             } elseif ($this->param["models"] == 'propal_send') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentSendProposal");
             } elseif ($this->param["models"] == 'order_send') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentSendOrder");
             } elseif ($this->param["models"] == 'order_supplier_send') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentSendSupplierOrder");
             } elseif ($this->param["models"] == 'invoice_supplier_send') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentSendSupplierInvoice");
             } elseif ($this->param["models"] == 'shipping_send') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentSendShipping");
             } elseif ($this->param["models"] == 'fichinter_send') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentSendFichInter");
             } elseif ($this->param["models"] == 'thirdparty') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentThirdparty");
             } elseif (!is_numeric($this->withbody)) {
                 $defaultmessage = $this->withbody;
             }
             // Complete substitution array
             if (!empty($conf->paypal->enabled) && !empty($conf->global->PAYPAL_ADD_PAYMENT_URL)) {
                 require_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php';
                 $langs->load('paypal');
                 if ($this->param["models"] == 'order_send') {
                     $url = getPaypalPaymentUrl(0, 'order', $this->substit['__ORDERREF__']);
                     $this->substit['__PERSONALIZED__'] = str_replace('\\n', "\n", $langs->transnoentitiesnoconv("PredefinedMailContentLink", $url));
                 }
                 if ($this->param["models"] == 'facture_send') {
                     $url = getPaypalPaymentUrl(0, 'invoice', $this->substit['__FACREF__']);
                     $this->substit['__PERSONALIZED__'] = str_replace('\\n', "\n", $langs->transnoentitiesnoconv("PredefinedMailContentLink", $url));
                 }
             }
             $defaultmessage = str_replace('\\n', "\n", $defaultmessage);
             // Deal with format differences between message and signature (text / HTML)
             if (dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__SIGNATURE__'])) {
                 $this->substit['__SIGNATURE__'] = dol_nl2br($this->substit['__SIGNATURE__']);
             } else {
                 if (!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__SIGNATURE__'])) {
                     $defaultmessage = dol_nl2br($defaultmessage);
                 }
             }
             if (isset($_POST["message"])) {
                 $defaultmessage = $_POST["message"];
             } else {
                 $defaultmessage = make_substitutions($defaultmessage, $this->substit);
                 // Clean first \n and br (to avoid empty line when CONTACTCIVNAME is empty)
                 $defaultmessage = preg_replace("/^(<br>)+/", "", $defaultmessage);
                 $defaultmessage = preg_replace("/^\n+/", "", $defaultmessage);
             }
             $out .= '<tr>';
             $out .= '<td width="180" valign="top">' . $langs->trans("MailText") . '</td>';
             $out .= '<td>';
             if ($this->withbodyreadonly) {
                 $out .= nl2br($defaultmessage);
                 $out .= '<input type="hidden" id="message" name="message" value="' . $defaultmessage . '" />';
             } else {
                 if (!isset($this->ckeditortoolbar)) {
                     $this->ckeditortoolbar = 'dolibarr_notes';
                 }
                 // Editor wysiwyg
                 require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
                 if ($this->withfckeditor == -1) {
                     if (!empty($conf->global->FCKEDITOR_ENABLE_MAIL)) {
                         $this->withfckeditor = 1;
                     } else {
                         $this->withfckeditor = 0;
                     }
                 }
                 $doleditor = new DolEditor('message', $defaultmessage, '', 280, $this->ckeditortoolbar, 'In', true, true, $this->withfckeditor, 8, 72);
                 $out .= $doleditor->Create(1);
             }
             $out .= "</td></tr>\n";
         }
         if ($this->withform == 1 || $this->withform == -1) {
             $out .= '<tr><td align="center" colspan="2"><center>';
             $out .= '<input class="button" type="submit" id="sendmail" name="sendmail" value="' . $langs->trans("SendMail") . '"';
             // Add a javascript test to avoid to forget to submit file before sending email
             if ($this->withfile == 2 && $conf->use_javascript_ajax) {
                 $out .= ' onClick="if (document.mailform.addedfile.value != \'\') { alert(\'' . dol_escape_js($langs->trans("FileWasNotUploaded")) . '\'); return false; } else { return true; }"';
             }
             $out .= ' />';
             if ($this->withcancel) {
                 $out .= ' &nbsp; &nbsp; ';
                 $out .= '<input class="button" type="submit" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '" />';
             }
             $out .= '</center></td></tr>' . "\n";
         }
         $out .= '</table>' . "\n";
         if ($this->withform == 1) {
             $out .= '</form>' . "\n";
         }
         $out .= "<!-- Fin form mail -->\n";
         return $out;
     }
 }
             }
             print '</td>';
             // Info
             $htmltooltip = '' . $langs->trans("Name") . ': ' . $module->name;
             $htmltooltip .= '<br>' . $langs->trans("Type") . ': ' . ($module->type ? $module->type : $langs->trans("Unknown"));
             if ($module->type == 'pdf') {
                 $htmltooltip .= '<br>' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur;
             }
             $htmltooltip .= '<br><br><u>' . $langs->trans("FeaturesSupported") . ':</u>';
             $htmltooltip .= '<br>' . $langs->trans("Logo") . ': ' . yn($module->option_logo, 1, 1);
             $htmltooltip .= '<br>' . $langs->trans("PaymentMode") . ': ' . yn($module->option_modereg, 1, 1);
             $htmltooltip .= '<br>' . $langs->trans("PaymentConditions") . ': ' . yn($module->option_condreg, 1, 1);
             $htmltooltip .= '<br>' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang, 1, 1);
             //$htmltooltip.='<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
             //$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
             $htmltooltip .= '<br>' . $langs->trans("WatermarkOnDraftOrders") . ': ' . yn($module->option_draft_watermark, 1, 1);
             print '<td align="center">';
             print $form->textwithpicto('', $htmltooltip, 1, 0);
             print '</td>';
             // Preview
             print '<td align="center">';
             if ($module->type == 'pdf') {
                 print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '">' . img_object($langs->trans("Preview"), 'bill') . '</a>';
             } else {
                 print img_object($langs->trans("PreviewNotAvailable"), 'generic');
             }
             print '</td>';
             print "</tr>\n";
         }
     }
 }
Beispiel #30
0
                        print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&amp;value=' . $name . '&amp;scandir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
                        print "</td>";
                    }
                    // Defaut
                    print "<td align=\"center\">";
                    if ($conf->global->LIVRAISON_ADDON_PDF == "{$name}") {
                        print img_picto($langs->trans("Default"), 'on');
                    } else {
                        print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&amp;value=' . $name . '&amp;scandir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
                    }
                    print '</td>';
                    // Info
                    $htmltooltip = '' . $langs->trans("Type") . ': ' . ($module->type ? $module->type : $langs->trans("Unknown"));
                    $htmltooltip .= '<br>' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur;
                    $htmltooltip .= '<br><br>' . $langs->trans("FeaturesSupported") . ':';
                    $htmltooltip .= '<br>' . $langs->trans("Logo") . ': ' . yn($module->option_logo, 1, 1);
                    print '<td align="center">';
                    print $form->textwithpicto('', $htmltooltip, 1, 0);
                    print '</td>';
                    print '<td align="center">';
                    print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '">' . img_object($langs->trans("Preview"), 'sending') . '</a>';
                    print '</td>';
                    print '</tr>';
                }
            }
            closedir($handle);
        }
    }
}
print '</table>';
/*